ShardedSessionImpl.isOpen() is inconsistent with SessionImpl.isOpen()
---------------------------------------------------------------------
Key: HSHARDS-46
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-46
Project: Hibernate Shards
Issue Type: Bug
Components: engine
Reporter: Max Ross
Assignee: Max Ross
Fix For: 3.0.0
Email exchange between Aviad and Max:
Aviad:
I am working on using a Spring SessionFatoryBean class, so the Shard Session can be
integrated correctly with the Spring TrasnsactionManager (not distributed transactions)
and the OpenSessionInViewFilter.
While debugging this issue, we encountered that the isOpen method of the
ShardedSessionImpl is not acting as the hibernate session version.
In hibernate if a session is not closed then it is open, meaning every created session
that wasn't closed is treated as open.
In the Shard implementation the method looks for an open HibernateSession in order to
return 'true'. This issue causes an unexpected behavior with Spring Transactions,
so unless there is an unseen reason for this implementation I suggest to change the method
isOpen to return true as long as the session wasn't closed.
Max:
Great, I'm glad to hear you're making progress. I think I understand the issue
with isOpen but let me just make sure. The problem in Shards is that a ShardedSession is
only considered open if it contains at least one open Session. Since we don't open
Sessions until someone performs an operation on the ShardedSession that actually requires
a Session, if you create a new ShardedSession and immediately call isOpen() it will return
false, whereas if you create a regular Session and immediately call isOpen() it will
return true. If I understand the problem correctly that makes sense I can submit the
change.
Aviad:
About the problem we discussed you did understand correctly, and I will be glad if it will
be changed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira