xaDataSource.setDatabaseName(shortDbName);
appendAttrString(p);
if (attrString != null)
xaDataSource.setConnectionAttributes(attrString);
EngineConnection conn = getConnection();
// If we have no existing connection. this is a brand new XAConnection.
if (conn == null)
{
xaConnection = xaDataSource.getXAConnection(userId,password);
setXAResource(xaConnection.getXAResource());
}
else // this is just a connection reset. Close the logical connection.
{
conn.close();
}
// Get a new logical connection.
// Contract between network server and embedded engine
// is that any connection returned implements EngineConnection.
conn = (EngineConnection) xaConnection.getConnection();
// Client will always drive the commits so connection should
// always be autocommit false on the server. DERBY-898/DERBY-899
conn.setAutoCommit(false);
setConnection(conn);
}