openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Bauer <techhu...@gmail.com>
Subject Re: AW: OpenJPA transactions
Date Wed, 28 Mar 2012 17:19:23 GMT
I'm not very familiar with how transaction management works within
Aries, but for JPA in general, if you are using JTA transactions you
should not use em.getTransaction().begin().  That API should only be
used for resource local transactions (non-JTA, direct to the
database).  It looks like the Aries site has some good JPA related
information here:  http://aries.apache.org/modules/jpaproject.html.
In particular, take a look at incidentDAO.  That bean has a
container-managed transactional element specified.  I suspect you'll
need to do something similar in your application.

hth,
Jeremy

On Wed, Mar 28, 2012 at 11:54 AM, javidelgadillo <jdelgadillo@esri.com> wrote:
> Bobitz,
>
> Thanks for the suggestion, but that didn't make a difference.
>
> As an FYI, here's the output when I start Karaf:
> 31  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.Runtime -
> Setting the following properties from "?" into configuration:
> {javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl,
> openjpa.RuntimeUnenhancedClasses=unsupported,
> javax.persistence.sharedCache.mode=UNSPECIFIED,
> openjpa.Log=DefaultLevel=TRACE, PersistenceVersion=1.0,
> openjpa.Id=metadataPersistenceUnit, openjpa.ConnectionFactoryMode=managed,
> openjpa.ConnectionFactory=org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource@556aa9,
> javax.persistence.validation.mode=AUTO,
> openjpa.jdbc.SynchronizeMappings=buildSchema,
> openjpa.ManagedRuntime=jndi(TransactionManagerName=osgi:service/javax.transaction.TransactionManager),
> openjpa.TransactionMode=managed,
> openjpa.MetaDataFactory=jpa(Types=MetadataEntity),
> openjpa.ClassResolver=org.apache.openjpa.persistence.PersistenceUnitInfoImpl$ClassResolverImpl@157c76a,
> openjpa.ConnectionFactory2=org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource@1cdbaf7}
> 46  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.Runtime - No
> cache marshaller found for id
> org.apache.openjpa.conf.MetaDataCacheMaintenance.
> 202  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.MetaData -
> Scanning resource "META-INF/orm.xml" for persistent types.
> 202  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.MetaData -
> The persistent unit root url is "null"
> 202  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.MetaData -
> parsePersistentTypeNames() found [MetadataEntity].
> 202  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.MetaData -
> Found 1 classes with metadata in 15 milliseconds.
> 0  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.Runtime -
> Setting the following properties from "?" into configuration:
> {openjpa.BrokerFactory=jdbc,
> javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl,
> openjpa.RuntimeUnenhancedClasses=unsupported,
> javax.persistence.sharedCache.mode=UNSPECIFIED,
> openjpa.Log=DefaultLevel=TRACE, PersistenceVersion=1.0,
> openjpa.Id=metadataPersistenceUnit, openjpa.ConnectionFactoryMode=managed,
> openjpa.ConnectionFactory=org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource
> @556aa9, javax.persistence.validation.mode=AUTO,
> openjpa.jdbc.SynchronizeMappings=buildSchema,
> openjpa.ManagedRuntime=jndi(TransactionManagerName=osgi:service/javax.transaction.TransactionManager),
> openjpa.TransactionMode=managed, openjpa.BrokerImpl=non-finalizing,
> openjpa.MetaDataFactory=jpa(Types=MetadataEntity),
> openjpa.ClassResolver=org.apache.openjpa.persistence.PersistenceUnitInfoImpl$ClassResolverImpl@157c76a,
> openjpa.ConnectionFactory2=org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource@1cdbaf7}
> 109  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.Runtime - Not
> creating a ValidatorImpl because this app is using the JPA 1.0 Spec
> 203  metadataPersistenceUnit  TRACE  [FelixStartLevel] openjpa.Runtime -
> org.apache.openjpa.persistence.PersistenceProviderImpl@1f543bb creating
> container org.apache.openjpa.persistence.EntityManagerFactoryImpl@131cfec
> for PU metadataPersistenceUnit.
>
>
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/OpenJPA-transactions-tp7411924p7414446.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message