Hi,
I am using JdbcEventStorageEngine with my own implementation of ConnectionProvider and TransactionManager (implemented using SqlSessionManager from MyBatis, I am constrained not to used axon-spring)
and I am facing following situation when database connection is closed before transaction commit.
For example this snippet of code
transactionManager.executeInTransaction( () ->
executeBatch(
getConnection(),
connection -> { return some prepated statement },
e -> handlePersistenceException(e, event)
)
);
Will will to this:
1. start transaction through transaction manager
2. request database connection using connection provider
3. invoke executeBatch method from JdbcUtils
3.1. execute sql statement
3.2. close quietly database connection
4. commit transaction
So my problem is that the moment when transaction needs to be committed the connection is already closed so the commit fails.
Any help and feedback is very useful
Cheers,
Valeri