mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
* Refactor DefaultTransactionThreadLocal, convert ThreadLocal to field (from map) * Add test for multiple database thread locals
44 lines
951 B
Java
44 lines
951 B
Java
package io.ebeaninternal.api;
|
|
|
|
import io.ebean.TxScope;
|
|
import io.ebeaninternal.server.transaction.TransactionScopeManager;
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
/**
|
|
* Service provider interface for the transaction manager.
|
|
*/
|
|
public interface SpiTransactionManager {
|
|
|
|
/**
|
|
* Return the scope manager for this server.
|
|
*/
|
|
TransactionScopeManager scope();
|
|
|
|
/**
|
|
* Return the main DataSource.
|
|
*/
|
|
DataSource getDataSource();
|
|
|
|
/**
|
|
* Return the read only DataSource (if defined).
|
|
*/
|
|
DataSource getReadOnlyDataSource();
|
|
|
|
/**
|
|
* Return the currently active transaction (can be null).
|
|
*/
|
|
SpiTransaction getActive();
|
|
|
|
/**
|
|
* Push an externally managed transaction into scope (e.g. Spring managed transaction).
|
|
*/
|
|
ScopedTransaction externalBeginTransaction(SpiTransaction transaction, TxScope txScope);
|
|
|
|
/**
|
|
* Called when an externally managed transaction has completed.
|
|
*/
|
|
void externalRemoveTransaction();
|
|
|
|
}
|