if (cfElem != null)
{
txConnectionFactoryName = cfElem.getAttribute("name");
try
{
ConnectionFactory cf = (ConnectionFactory)nucleusContext.getPluginManager().createExecutableExtension(
"org.datanucleus.store_connectionfactory",
new String[] {"datastore", "transactional"},
new String[] {storeManagerKey, "true"}, "class-name",
new Class[] {StoreManager.class, String.class},
new Object[] {this, "tx"});
connectionMgr.registerConnectionFactory(txConnectionFactoryName, cf);
if (NucleusLogger.CONNECTION.isDebugEnabled())
{
NucleusLogger.CONNECTION.debug(LOCALISER.msg("032018", txConnectionFactoryName));
}
}
catch (Exception e)
{
throw new NucleusException("Error creating transactional connection factory", e).setFatal();
}
}
else
{
throw new NucleusException("Error creating transactional connection factory. No connection factory plugin defined");
}
// Factory for connections - nontransactional
cfElem = nucleusContext.getPluginManager().getConfigurationElementForExtension(
"org.datanucleus.store_connectionfactory",
new String[] {"datastore", "transactional"}, new String[] {storeManagerKey, "false"});
if (cfElem != null)
{
nontxConnectionFactoryName = cfElem.getAttribute("name");
try
{
ConnectionFactory cf = (ConnectionFactory)nucleusContext.getPluginManager().createExecutableExtension(
"org.datanucleus.store_connectionfactory",
new String[] {"datastore", "transactional"},
new String[] {storeManagerKey, "false"}, "class-name",
new Class[] {StoreManager.class, String.class},
new Object[] {this, "nontx"});