Default transaction type to RESOURCE_LOCAL. Spec changed in late revision

to default based on environment, rather than always defaulting to JTA.



git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@426351 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2006-07-28 01:16:51 +00:00
parent 1236605135
commit 7268ed8f80
1 changed files with 4 additions and 2 deletions

View File

@ -354,10 +354,12 @@ public class ConfigurationProviderImpl
_info = new PersistenceUnitInfoImpl();
_info.setPersistenceUnitName(attrs.getValue("name"));
// default is JTA according to spec
// we only parse this ourselves outside a container, so default
// transaction type to local
String val = attrs.getValue("transaction-type");
if (val == null)
_info.setTransactionType(PersistenceUnitTransactionType.JTA);
_info.setTransactionType
(PersistenceUnitTransactionType.RESOURCE_LOCAL);
else
_info.setTransactionType(Enum.valueOf
(PersistenceUnitTransactionType.class, val));