About commit

forum_thread

Optimistic lock

Hello When I get an optimistic lock on an object, refresh(), start trans and persist?  Will the changes made to the object before the violation be retained or must they be duplicated in the retry code?  Assuming it affects only one object.  tia. ... and I simple need to create a new transaction, persist and commit the object?  Or do I need to refresh() the object start a transaction, reapply the changes,persist and commit? edit ...

 
issue

InternalException

Hi, 3 Days before our rollout.. We've just got this when trying to commit persist of a bunch of entities into the DB   ... our rollout.. We've just got this when trying to commit persist of a bunch of entities into the DB   Caused by: com.objectdb.o._RollbackException: Failed to commit transaction: at com.objectdb.o.JPE.g(JPE.java:89) ... [objectdb-2.4.0.jar:] at com.objectdb.jpa.EMImpl.commit(EMImpl.java:279) [objectdb-2.4.0.jar:] {..} ... 25 more Caused by: ...

 
manual

DELETE Queries in JPA/JPQL

Explains how to apply server side bulk delete using a JPA/JPQL query.... Applying changes to the database by calling the commit method. JPQL DELETE queries provide an alternative way ... (which use other EntityManager instances) only after commit . This page covers the following topics: ...

 
forum_thread

Unexpected behaviour upon update. Bug?

This sample does not work as I expect.  Why?  Is it a bug? Below is the complete program. Expect: 3 Get: 4 import java.io.Serializable; import java.util.List; import javax.persistence.*; @Entity public class Update implements Serializable   {     @Id     int i;     int v; ... ; em. getTransaction ( ) . commit ( ) ;   simple. v = 4 ; ... invisible in other  EntityManager instances until commit, but visible in the  EntityManager in which they occurred. ...

 
forum_thread

Like fails if both underscore and percent are used

When using a like query that has both _ and % in it, ObjectDB seems to fail. Here is a unit test to demonstrate:   ... } em. getTransaction ( ) . commit ( ) ; }   @ Test ... ; em. getTransaction ( ) . commit ( ) ;   assertEquals ( 1 , ...

 
forum_thread

Problem with byte arrays in JDO - ClassCastException

A bizarre ClassCastException is thrown if I attempt to obtain a byte array field as the result of a Query: Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to [B at spiffy.test.ObjectdbTest.main(ObjectdbTest.java:44) ... ; pm. currentTransaction ( ) . commit ( ) ; pm. currentTransaction ( ... ; pm. currentTransaction ( ) . commit ( ) ; query = pm. newQuery ( ...

 
forum_thread

Schema-Update: Rename superclass and remove one subclass

Hello, we renamed a superclass and removed one of the subclass. If we then try to open the Database (with ObjectDB-Explorer) we get a "Failed to generate dynamic type ..."   Small Example: Generate Database ... ) ; em. getTransaction ( ) . commit ( ) ;   em. close ( ) ; ... "b" ; em. getTransaction ( ) . commit ( ) ;   em. close ( ) ; ...

 
issue

Unexpected exception (Error 990) - Merge with no Transaction

I am frequently having an error when merging a detached object outside of a transaction. (Is this allowed? I am not trying to modify the object, just read data from it.) Here is a test case: ... ; em. getTransaction ( ) . commit ( ) ; em. close ( ) ; ... ; em. getTransaction ( ) . commit ( ) ; em. close ( ) ; ...

 
api-jdo

setDetachAllOnCommit(flag)

Sets the detachAllOnCommit setting.(Method of javax.jdo.PersistenceManager)

 
forum_thread

Intermittent: "Attempt to reuse an existing primary key value" when persisting a new instance

Hi,   I don't have a useful test case to expose this issue, but I am getting an intermittent "Attempt to reuse an existing primary key value". In this particular instance, the error is: ... enterprise . transaction . JavaEETransactionImpl . commit ( JavaEETransactionImpl. java : 453 ) at ... . transaction . JavaEETransactionManagerSimplified . commit ( JavaEETransactionManagerSimplified. java : 857 ) ...