Hi areider, I think you have to take your OpenJPA manual reference in context of the overall actions being described. In each of these sub-sections on persist, remove, etc, there is mention of the "next flush or commit". The persist() invocation by itself does not interact with the database. That doesn't happen until the flush or commit is performed. At which time, some type of transaction is necessary in order to complete the operation against the database.
So, if you combine the em.persist() invocation and the transaction context as the "action", then this statement you referenced is accurate: "This action can only be used in the context of an active transaction." You might say that I'm splitting hairs, but I believe that was the intent of the description. Kevin On Mon, Nov 7, 2011 at 5:27 PM, areider <open...@reider.net> wrote: > I've seen a TransactionRequiredException error occur on persist() when no > transaction is active, for an extended persistence context. jsr220 states, > in 3.1.1: > > /* > * @throws TransactionRequiredException if invoked on a > * container-managed entity manager of type > * PersistenceContextType.TRANSACTION and there is > * no transaction > */ > > In 3.3 it states: > When an EntityManager with an extended persistence context is used, the > persist, remove, merge, and > refresh operations may be called regardless of whether a transaction is > active. > > However, in the OpenJPA documention at > > http://openjpa.apache.org/builds/apache-openjpa-1.2.3-SNAPSHOT/docs/manual/manual.html#jpa_overview_em_trans > > > it states: > > This action [persist] can only be used in the context of an active > transaction. > > without any qualification as to the persistenceContextType of the entity > manager. > > Is OpenJPA in compliance with the spec here? > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/TransactionRequiredException-on-persist-on-extended-EM-tp6972526p6972526.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >