-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Setting batch size to 0 for one transaction / session only?
PostPosted: Fri Oct 15, 2004 2:28 pm 
Expert
Expert

Joined: Thu Jan 08, 2004 6:17 pm
Posts: 278
We have just changed a long string column to have Hibernate mapping "text" which maps to Oracle "clob". On Oracle, we are now getting the exceptions below (cannot batch insert stream types).

Is there a way to set the JDBC batch size to 0 only within one transaction and one session? JDBC batch updating is working great everywhere else and we do not want to turn it off globally -- we only want to disable it for transactions where we insert these clob-containing rows. Is this possible?


Hibernate version: 2.1.1

Mapping documents: We just changed one of our tables to map a long string field as type "text".

Full stack trace of any exception that occurs:

Code:
[RMI TCP Connection(64)-10.0.0.30] 2004-10-15 10:42:14,976 : ERROR  - JDBCExceptionReporter.logExceptions : operation not allowed: streams type cannot be used in batching
[RMI TCP Connection(64)-10.0.0.30] 2004-10-15 10:42:14,977 : ERROR  - JDBCException.<init> : could not insert: [com.nimblefish.core.domain.function.Rule#4705]
java.sql.SQLException: operation not allowed: streams type cannot be used in batching
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
   at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:2781)
   at net.sf.hibernate.impl.BatchingBatcher.addToBatch(BatchingBatcher.java:30)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:469)
   at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:443)
   at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
   at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2308)
   at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2261)
   at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2187)
   at com.nimblefish.core.persist.Persistence.flush(Persistence.java:412)
   at com.nimblefish.sdk.ejb.session.FunctionServiceBean.createRule(FunctionServiceBean.java:96)


Name and version of the database you are using:
Oracle 9i


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 15, 2004 2:32 pm 
Expert
Expert

Joined: Thu Jan 08, 2004 6:17 pm
Posts: 278
Sorry to follow myself up, but... let me ask it this way: is it the case that the batch size is stored in the SessionFactory? If we need a session with batch size 0, does this mean we need to use a different SessionFactory? I'll try that....

Cheers!
Rob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.