mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
#2818 - Fix Concurrent modification of listenerNotify TransactionEvent list
The issue fixed here is that SavepointTransaction was effectively using the TransactionEvent of the underlying 'parent' transaction. The fix is for SavepointTransaction to have its own TransactionEvent.
This commit is contained in:
1 parent
563340edbd
commit
bcc21b1c04
2 files changed
+17
No files matched your search
+10
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.transaction;
|
||||
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import io.ebeaninternal.api.SpiTransactionProxy;
|
||||
import io.ebeaninternal.api.TransactionEvent;
|
||||
import io.ebeaninternal.server.util.Str;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -25,6 +26,7 @@ final class SavepointTransaction extends SpiTransactionProxy {
|
||||
|
||||
private boolean rollbackOnly;
|
||||
private int state;
|
||||
private TransactionEvent event;
|
||||
|
||||
SavepointTransaction(SpiTransaction transaction, TransactionManager manager) throws SQLException {
|
||||
this.manager = manager;
|
||||
@@ -40,6 +42,14 @@ final class SavepointTransaction extends SpiTransactionProxy {
|
||||
this.logPrefix = transaction.getLogPrefix() + spPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransactionEvent getEvent() {
|
||||
if (event == null) {
|
||||
event = new TransactionEvent();
|
||||
}
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLogPrefix() {
|
||||
return logPrefix;
|
||||
|
||||
Reference in new issue
Block a user