public void setIsolationLevel(String level)
{
assertNotCommitting();
if (tx.isActive() && !tx.getOptimistic())
{
throw new JDOUnsupportedOptionException("Cannot change the transaction isolation level while a datastore transaction is active");
}
PersistenceManagerFactory pmf = pm.getPersistenceManagerFactory();
if (!pmf.supportedOptions().contains("javax.jdo.option.TransactionIsolationLevel." + level))
{
throw new JDOUnsupportedOptionException("Isolation level \"" + level + "\" not supported by this datastore");
}
int isolationLevel = TransactionUtils.getTransactionIsolationLevelForName(level);
tx.setOption(org.datanucleus.Transaction.TRANSACTION_ISOLATION_OPTION, isolationLevel);
}