mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#919 - io.ebean package initial
This commit is contained in:
1 parent
5821dc96b9
commit
971e2dc91b
2134 files changed
+10721
-8652
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package io.ebeaninternal.server.transaction;
|
||||
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
/**
|
||||
* Transaction manager used for doc store only EbeanServer instance.
|
||||
* <p>
|
||||
* There is no underlying JDBC DataSource etc
|
||||
*/
|
||||
public class DocStoreTransactionManager extends TransactionManager {
|
||||
|
||||
private final AtomicLong counter = new AtomicLong(1000L);
|
||||
|
||||
/**
|
||||
* Create the TransactionManager
|
||||
*/
|
||||
public DocStoreTransactionManager(TransactionManagerOptions options) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiTransaction createTransaction(boolean explicit, int isolationLevel) {
|
||||
long id = counter.incrementAndGet();
|
||||
return createTransaction(explicit, null, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiTransaction createQueryTransaction(Object tenantId) {
|
||||
return new DocStoreOnlyTransaction("", false, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpiTransaction createTransaction(boolean explicit, Connection c, long id) {
|
||||
return new DocStoreOnlyTransaction(prefix + id, explicit, this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user