mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 06:45:21 +00:00
#2424 Preserve using PersistenceException when transaction register(Callback) called with no active transaction
This commit is contained in:
1 parent
4d34c9e868
commit
fcda419abb
2 files changed
+7
-3
No files matched your search
@@ -691,7 +691,11 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
@Override
|
||||
public void register(TransactionCallback transactionCallback) {
|
||||
currentTransaction().register(transactionCallback);
|
||||
Transaction transaction = currentTransaction();
|
||||
if (transaction == null) {
|
||||
throw new PersistenceException("Not currently active transaction when trying to register transactionCallback");
|
||||
}
|
||||
transaction.register(transactionCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user