use of javax.transaction.Transaction in project hibernate-orm by hibernate.
the class ClusteredTimestampsRegionImpl method evictAll.
@Override
public void evictAll() throws CacheException {
// TODO Is this a valid operation on a timestamps cache?
final Transaction tx = suspend();
try {
// Invalidate the local region and then go remote
invalidateRegion();
Caches.broadcastEvictAll(cache);
} finally {
resume(tx);
}
}
use of javax.transaction.Transaction in project graphdb by neo4j-attic.
the class MasterImpl method suspendOtherAndResumeThis.
Transaction suspendOtherAndResumeThis(SlaveContext txId) {
try {
TransactionManager txManager = graphDbConfig.getTxModule().getTxManager();
Transaction otherTx = txManager.getTransaction();
Transaction transaction = getTx(txId);
if (otherTx != null && otherTx == transaction) {
return null;
} else {
if (otherTx != null) {
txManager.suspend();
}
if (transaction == null) {
beginTx(txId);
} else {
txManager.resume(transaction);
}
return otherTx;
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
use of javax.transaction.Transaction in project graphdb by neo4j-attic.
the class MasterImpl method beginTx.
private Transaction beginTx(SlaveContext txId) {
try {
TransactionManager txManager = graphDbConfig.getTxModule().getTxManager();
txManager.begin();
Transaction tx = txManager.getTransaction();
transactions.put(txId, tx);
return tx;
} catch (NotSupportedException e) {
throw new RuntimeException(e);
} catch (SystemException e) {
throw new RuntimeException(e);
}
}
use of javax.transaction.Transaction in project graphdb by neo4j-attic.
the class LockReleaser method commit.
public void commit() {
Transaction tx = getTransaction();
// propertyIndex
propertyIndexManager.commit(tx);
releaseCows(tx, Status.STATUS_COMMITTED);
releaseLocks(tx);
}
use of javax.transaction.Transaction in project graphdb by neo4j-attic.
the class LockReleaser method getAndSetupPrimitiveElement.
private PrimitiveElement getAndSetupPrimitiveElement() {
Transaction tx = getTransaction();
if (tx == null) {
throw new NotInTransactionException();
}
PrimitiveElement primitiveElement = cowMap.get(tx);
if (primitiveElement == null) {
primitiveElement = new PrimitiveElement();
cowMap.put(tx, primitiveElement);
}
return primitiveElement;
}
Aggregations