|
From: William R. L. <wr...@ex...> - 2003-09-27 04:12:06
|
Fellow Hibernaters,
I'm receiving an Exception in a Hibernate application I've built, and I'm
a bit confused as to why this might be happening. The code at where the
Exception is thrown is quite simple, and I think this might be a bug in
Hibernate itself. I've searched Google for this to no avail, and I'm
using the latest recommended Hibernate release as available on the site.
The exception I receive has a stacktrace as follows:
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.remove(Unknown Source)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at net.sf.hibernate.transaction.JDBCTransaction.commit(
JDBCTransaction.java:57
)
at org.express.ftpsrv.ConnectionHandler.<init>(ConnectionHandler.java:72)
at org.express.ftpsrv.ConnectionListener.accept(ConnectionListener.java:56)
at org.express.ftpsrv.ConnectionListener.main(ConnectionListener.java:19)
And the code at ConnectionHandler.java:72 that causes this looks like:
52:this.ftpSession = new FtpSession();
53:
54:/* ftpSession.setSessionId() does not operate on the unique
55: * 'id' field that is also part of the ftpSession object.
56: */
57:ftpSession.setSessionId(UniqueGenerator.makeUniqueNumber());
58:
59:Date currentDate = new Date();
60:currentDate.setTime(System.currentTimeMillis());
61:this.ftpSession.setBegTime(currentDate);
62:
63:net.sf.hibernate.Session hSession = null;
64:Transaction transaction = null;
65:
66:try
67:{
68: hSession = SessionHolder.getSession();
69:
70: transaction = hSession.beginTransaction();
71: hSession.save(this.session);
72: transaction.commit();
73:} catch (HibernateException e)
74:{
75: transaction.rollback();
76:}
I'd like to point out that this seems to be an intermittent thing,
occurring more often when I instantiate many objects quickly (the quoted
lines 52-72, above, are within a cronstructor in the Object).
Does anyone have any ideas as to what might be happening or where I might
look for additional information in order to track down this bug?
Thanks, in advance, for any response on this.
-- _
__ __ ___ _| | William R. Lorenz <wr...@ex...>
\ V V / '_| | http://www.clevelandlug.net/ ; "Every revolution was
\./\./|_| |_| first a thought in one man's mind." - Ralph Waldo Emerson
|