* @param records list of records to be detached.
* @param keepJoinRecord if true, keep the join record. Otherwise, delete it.
* @return updated AssociatedRecords.
*/
public AssociatedRecords detach(List<? extends ActiveRecord> records, boolean keepJoinRecord) {
ImplicitTransactionManager tm = TransactionManagerUtil.getImplicitTransactionManager();
AssociatedRecords assocs = null;
try {
tm.beginTransactionImplicit();
assocs = internal_detach(records, keepJoinRecord);
tm.commitTransactionImplicit();
}
catch(GenericException ex) {
tm.rollbackTransactionImplicit();
throw ex;
}
finally {
tm.releaseResourcesImplicit();
}
return assocs;
}