David Rogers
02/15/2023, 6:19 PMDavid Rogers
02/15/2023, 6:20 PMtransaction {
transaction action="setSavePoint" savepoint="SOME_SAVEPOINT_NAME";
queryExecute("select 42")
// There are no savepoint with name [some_savepoint_name] set
transaction action="rollback" savepoint="SOME_SAVEPOINT_NAME";
}
It is unfortunate because it works fine inside some coldbox tests we've got, but then on contact with the real world it flops over.
It looks somewhat related to https://luceeserver.atlassian.net/browse/LDEV-3657 ("savepoints not supported on ORM transactions") ...
If it is "orm" related, is there a way to:
• know if I'm in an ORM transaction?
• commit/cancel/tear-down/etc. the ORM transaction if inside one?David Rogers
02/15/2023, 6:51 PM// FUTURE
public void savepoint(String savePointName) throws DatabaseException {
if (autoCommit || _size() == 0) return;
autoCommit is false
_size() is 0 so we bail
private int _size() {
return /*0*/ transConnsORM.size() + /*0*/ transConnsReg.size();
}
but whyDavid Rogers
02/15/2023, 6:57 PMtransaction {
queryExecute("select 42") // prime the pump
transaction action="setSavePoint" savepoint="SOME_SAVEPOINT_NAME";
queryExecute("select 42")
transaction action="rollback" savepoint="SOME_SAVEPOINT_NAME";
}
now
private int _size() {
return /*0*/ transConnsORM.size() + /*1*/ transConnsReg.size();
}David Rogers
02/15/2023, 6:57 PMDavid Rogers
02/15/2023, 6:57 PMDavid Rogers
02/16/2023, 12:07 AMant fast work no problem.