You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider adding database.beginTransaction(connection) - support case of external Connection provided #2232
Query and query beans both have a method query.usingConnection(java.sql.Connection) ... so that is ok.
We should consider adding database.beginTransaction(connection) for the case where we have an external java.sql.Connection provided and want to use all Ebean functionality, not just queries.
Ebean has a method to turn a java.sql.Connection into a Transaction. Internally that is TransactionManager.wrapExternalConnection(Connection connection). Now, I thought that was exposed as public API but it is not.
We really should make the change to expose that method on Database. Something like:
// try with resourcestry (Transactiont = database.beginTransaction(connection)) {
// don't commit or rollback ... end() as a no-op
}
// as the connection is provided the expectation is that the // commit() / rollback() is also external code connection.commit();
Activity