[jboss-user] [EJB3] - Correct approach for creating a large number of records

John Ament do-not-reply at jboss.com
Fri Dec 10 10:20:19 EST 2010


John Ament [http://community.jboss.org/people/meetoblivion] created the discussion

"Correct approach for creating a large number of records"

To view the discussion, visit: http://community.jboss.org/message/575428#575428

--------------------------------------------------------------
I'm on JBoss AS 6.

I have a very large process that runs.  It consists of taking an entity and persisting it as well as a number of its children - roughly 12 child rows for each parent.  I can get it to successfully process the first 40 or so records, but then eventually I get this:


2010-12-10 10:10:11,257 WARN  [org.hibernate.util.JDBCExceptionReporter] (http-0.0.0.0-8080-2) SQL Error: 0, SQLState: null
2010-12-10 10:10:11,257 ERROR [org.hibernate.util.JDBCExceptionReporter] (http-0.0.0.0-8080-2) Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6 at bc9ef2
2010-12-10 10:10:11,258 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (http-0.0.0.0-8080-2) javax.ejb.EJBTransactionRolledbackException: could not insert:


In my ds.xml, I have setup


<max-pool-size>20000</max-pool-size>
      <idle-timeout-minutes>1</idle-timeout-minutes>
      <blocking-timeout-millis>60000</blocking-timeout-millis>

Is this a situation where I want to specify the JDBC batch size as well?  Overally, I'm a bit confused about why it wants to create so many connections - looks like one per record it wants to insert.  As a way to try to break it out further and further, I've even gotten to the point of directly using SessionFactory and StatelessSession in hibernate to avoid transactions, but no luck so far.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/575428#575428]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101210/d5bc7c92/attachment.html 


More information about the jboss-user mailing list