succeeded = true;
}
catch (SQLException e)
{
throw new NucleusDataStoreException(e.getMessage(),e);
}
finally
{
if (!succeeded)
{
try
{
cnx.close();
}
catch (SQLException e)
{
}
if (NucleusLogger.CONNECTION.isDebugEnabled())
{
String cnxStr = cnx.toString();
NucleusLogger.CONNECTION.debug(LOCALISER_RDBMS.msg("052003", cnxStr));
}
}
}
}
else
{
// Create basic Connection since no DatastoreAdapter created yet
cnx = ((DataSource)dataSource[0]).getConnection();
if (cnx == null)
{
String msg = LOCALISER_RDBMS.msg("052000", dataSource[0]);
NucleusLogger.CONNECTION.error(msg);
throw new NucleusDataStoreException(msg);
}
if (NucleusLogger.CONNECTION.isDebugEnabled())
{
NucleusLogger.CONNECTION.debug(LOCALISER_RDBMS.msg("052001", cnx.toString()));
}
}
}
catch (SQLException e)
{
throw new NucleusDataStoreException(e.getMessage(),e);
}
this.conn = cnx;
}
needsCommitting = true;