It must be bug in "SessionHolder".

----- Original Message -----
From: "Gavin King" <[EMAIL PROTECTED]>
To: "William R. Lorenz" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, September 27, 2003 1:48 PM
Subject: Re: [Hibernate] Hibernate Bug? [ConcurrentModificationException]


> We seem to be having some problems like this in more than one section
> of code. I really don't understand it at all; we suspect some kind of
> JVM bug. Unfortunately, no-one has been able to deliver a testcase
> that will help me reproduce this on my machine.
>
> I can't really do much, until I can reproduce it.
>
> P.S. You might also get this if you share a session between two
> threads - but at least some occurrences of this problem do not seem
> to be caused by this....
>
> William R. Lorenz wrote:
>
> >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 <[EMAIL PROTECTED]>
> >\ V  V / '_| | http://www.clevelandlug.net/ ; "Every revolution was
> > \./\./|_| |_| first a thought in one man's mind." - Ralph Waldo Emerson
> >
> >
> >
> >-------------------------------------------------------
> >This sf.net email is sponsored by:ThinkGeek
> >Welcome to geek heaven.
> >http://thinkgeek.com/sf
> >_______________________________________________
> >hibernate-devel mailing list
> >[EMAIL PROTECTED]
> >https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> >
> >
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to