gotConnection() may be called before our constructor is called (indeed it is),

so we need to create or update our session as appropriate therein.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1728 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2005-11-05 01:54:42 +00:00
parent b92cd64617
commit e65d89b3fd
@@ -46,9 +46,6 @@ public abstract class JORARepository extends SimpleRepository
{
super(provider, dbident);
// create our JORA session
_session = new Session((Connection)null);
// create our tables
createTables(_session);
}
@@ -227,8 +224,12 @@ public abstract class JORARepository extends SimpleRepository
protected void gotConnection (Connection conn)
{
// let our session know about this connection
_session.setConnection(conn);
// create or update our JORA session
if (_session == null) {
_session = new Session(conn);
} else {
_session.setConnection(conn);
}
}
protected Session _session;