[hibernate-dev] New pull request for HHH-7265 (ConcurrentModificationException)

Scott Marlow smarlow at redhat.com
Tue May 1 10:15:51 EDT 2012

Is this the safest way to fix?

What are the different use cases that SessionImpl.shouldAutoClose() 
needs to handle?  Identifying each one, will help me to review the code 


1.  The patch is changing the serialization of Hibernate Sessions to 
include the session owner.  Where is org.hibernate.SessionOwner?  Is 
org.hibernate.SessionOwner always serializable?  Could 
org.hibernate.SessionOwner reference anything that could be problematic 
for serialization?

2.  AbstractSessionImpl doesn't have a serialVersionUID but with this 
change to the Session serialization, I'm wondering if it should.

3.  Could this change introduce session leaks where the session owner 
doesn't close the session?

4.  Where is SessionBuilderImplementor?

5.  I see that the EntityManager will no longer register a 
synchronization with the transaction synchronization registry.  Are we 
introducing any problems by marking the EntityManager as closed, even 
though we are deferring the close?  How exactly will the session be 
closed after this EntityManager.close() code is reached (where is the 
call to EntityManager.shouldAutoCloseSession() coming from)?


On 05/01/2012 04:08 AM, Gail Badner wrote:
> ----- Original Message -----
>> From: "Gail Badner"<gbadner at redhat.com>
>> To: "Hibernate hibernate-dev"<hibernate-dev at lists.jboss.org>
>> Cc: "Steve Ebersole"<steve at hibernate.org>, "Scott Marlow"<smarlow at redhat.com>
>> Sent: Tuesday, May 1, 2012 1:06:55 AM
>> Subject: New pull request for HHH-7265 (ConcurrentModificationException)
>> I created a new pull request for master.
>> https://github.com/hibernate/hibernate-orm/pull/322
>> I have not created a pull request for metamodel yet, but I believe
>> the only difference from the master pull request would be:
>> - SessionBuilderImplementor.owner(SessionOwner) would be moved into
>> SessionBuilder
>> - references to SessionBuilderImplementor would be changed back to
>> SessionBuilder.
> - SessionBuilderImplementor could be removed.
>> Please take a look.
>> Thanks,
>> Gail

More information about the hibernate-dev mailing list