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:
@@ -46,9 +46,6 @@ public abstract class JORARepository extends SimpleRepository
|
|||||||
{
|
{
|
||||||
super(provider, dbident);
|
super(provider, dbident);
|
||||||
|
|
||||||
// create our JORA session
|
|
||||||
_session = new Session((Connection)null);
|
|
||||||
|
|
||||||
// create our tables
|
// create our tables
|
||||||
createTables(_session);
|
createTables(_session);
|
||||||
}
|
}
|
||||||
@@ -227,8 +224,12 @@ public abstract class JORARepository extends SimpleRepository
|
|||||||
|
|
||||||
protected void gotConnection (Connection conn)
|
protected void gotConnection (Connection conn)
|
||||||
{
|
{
|
||||||
// let our session know about this connection
|
// create or update our JORA session
|
||||||
_session.setConnection(conn);
|
if (_session == null) {
|
||||||
|
_session = new Session(conn);
|
||||||
|
} else {
|
||||||
|
_session.setConnection(conn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Session _session;
|
protected Session _session;
|
||||||
|
|||||||
Reference in New Issue
Block a user