/** * Accessor for the current DatastoreService for this ExecutionContext. Each PM/EM has its own * DatastoreService. * * @param ec ExecutionContext * @return The DatastoreService */ public DatastoreService getDatastoreService(ExecutionContext ec) { ManagedConnection mconn = ec.getStoreManager().getConnection(ec); return ((EmulatedXAResource) mconn.getXAResource()).getDatastoreService(); }
/** * Accessor for the current DatastoreTransaction for this ExecutionContext. Each PM/EM has its own * DatastoreService, and consequently can have a current DatastoreTransaction. * * @param ec ExecutionContext * @return The DatastoreTransaction if active, or null */ public DatastoreTransaction getDatastoreTransaction(ExecutionContext ec) { ManagedConnection mconn = ec.getStoreManager().getConnection(ec); return ((EmulatedXAResource) mconn.getXAResource()).getCurrentTransaction(); }