]
Max Ross resolved HSHARDS-48.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.0.0
NullPointerException in disconnect method
-----------------------------------------
Key: HSHARDS-48
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-48
Project: Hibernate Shards
Issue Type: Bug
Affects Versions: 3.0.0.Beta2
Reporter: Aviad Lichtenstadt
Assignee: Max Ross
Fix For: 3.0.0
Sometimes when the disconnect method of ShardedSessionImpl is called a
NullPointerException occurs
This happened when attaching the OpenSessionInViewFilter to a shardSessionFactory
Here is the fixed method (validate that the session is not null when calling disconnect:
public Connection disconnect() throws HibernateException {
for (Shard s : getShards()) {
Session sess = s.getSession();
if (sess != null) {
sess.disconnect();
}
}
// we do not allow application-supplied connections, so we can always return
// null
return null;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: