I tried your advice, it works. But when I tried to persist a large charater
object (about 1 A4 page data). I met a bug. Have you ever seen the following
bug?
I find out the CLOB property in my database has only 4000 bytes in
data_length. How can I persist a large character object?
================================================================
javax.servlet.ServletException: operation not allowed: streams type cannot
be used in batching
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
================================================================
Jason Thrasher wrote:
>
> Allan is correct, you need a CLOB, or a LOB. If you are using Hibernate
> you won't need to worry about which of the Clob data structures you'll
> use, as hibernate will choose it for you based on your database's dialect.
>
> The annotations for a String object like this might look like:
>
> @Lob
> @Basic(fetch = FetchType.LAZY)
> @Column
> private String cachedXml;
>
> public String getCachedXml() {
> return cachedXml;
> }
>
> public void setCachedXml(String cachedXml) {
> this.cachedXml = cachedXml;
> }
>
> Note that I'm using FetchType.LAZY because quering large items like this
> using Hibernate will really slow down the system and eat away at memory
> otherwise.
>
> I hope it helps,
> Jason
>
>
>
> phamvubinh wrote:
>>
>> There are many clob type in java:
>> - java.sql.Clob.
>> - oracle.sql.Clob.
>> - com.mysql.jdbc.Clob.
>> - org.hibernate.type.ClobType.
>> Which one can I use.
>>
>> I have tried some types of Clob, but the data_length in database just is
>> 4000. It's not enough for my data.
>>
>>
>> Allan Ang wrote:
>>>
>>> CLOB
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/How-to-insert-a-large-character-object-into-Oracle-database-from-Appfuse.-tf4833863s2369.html#a13852310
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]