mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#919 - io.ebean package initial
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package io.ebeaninternal.server.transaction;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Document store only transaction.
|
||||
*/
|
||||
public class DocStoreOnlyTransaction extends JdbcTransaction {
|
||||
|
||||
/**
|
||||
* Create a new DocStore only Transaction.
|
||||
*/
|
||||
public DocStoreOnlyTransaction(String id, boolean explicit, TransactionManager manager) {
|
||||
super(id, explicit, null, manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadOnly(boolean readOnly) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
protected void deactivate() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getInternalConnection() {
|
||||
throw new RuntimeException("not supported on DocStoreTransaction");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() {
|
||||
throw new RuntimeException("not supported on DocStoreTransaction");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performRollback() throws SQLException {
|
||||
// do nothing (could perhaps throw not supported exception)
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performCommit() throws SQLException {
|
||||
if (docStoreTxn != null) {
|
||||
manager.docStoreUpdateProcessor.commit(docStoreTxn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user