use of cbit.sql.InsertHashtable in project vcell by virtualcell.
the class DBTopLevel method insertVersionable.
/**
* This method was created in VisualAge.
* @return cbit.sql.Versionable
* @param object cbit.sql.Versionable
* @param name java.lang.String
* @param bVersion boolean
* @exception org.vcell.util.DataAccessException The exception description.
* @exception java.sql.SQLException The exception description.
* @exception cbit.sql.RecordChangedException The exception description.
*/
KeyValue insertVersionable(User user, Simulation simulation, KeyValue updatedMathDescriptionKey, String name, boolean bVersion, boolean bMathematicallyEquivalent, boolean bEnableRetry) throws DataAccessException, java.sql.SQLException, RecordChangedException {
Object lock = new Object();
Connection con = conFactory.getConnection(lock);
try {
KeyValue versionKey = simulationDB.insertVersionable(new InsertHashtable(), con, user, simulation, updatedMathDescriptionKey, name, bVersion, bMathematicallyEquivalent);
con.commit();
return versionKey;
} catch (Throwable e) {
lg.error(e.getMessage(), e);
try {
con.rollback();
} catch (Throwable rbe) {
// rbe.printStackTrace(System.out);
lg.error("exception during rollback, bEnableRetry = " + bEnableRetry);
}
if (bEnableRetry && isBadConnection(con)) {
conFactory.failed(con, lock);
return insertVersionable(user, simulation, updatedMathDescriptionKey, name, bVersion, bMathematicallyEquivalent, false);
} else {
handle_DataAccessException_SQLException(e);
// never gets here;
return null;
}
} finally {
conFactory.release(con, lock);
}
}
Aggregations