About commit

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

Uninitialized primary key (id = 0)

Exception in thread "main" [ObjectDB 2.2.9_04] javax.persistence.RollbackException Failed to commit transaction: Attempt to reuse an existing primary key value (image.Meta:0) (error 613) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:277) I check the db by explorer.jar, and find the only one record is id=0. What situation will be id=0? TIA ... javax. persistence . RollbackException Failed to commit transaction : Attempt to reuse an existing primary key value ... 613 ) at com. objectdb . jpa . EMImpl . commit ( EMImpl. java : 277 ) I check the db ...

 
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. ...

 
issue

Remove an entity which attributes were changed

We use an OSGi environment and we have three OSGi plugins.   In plugin A an entity is loaded and the entity is passed to plugin B. Plugin B changes an attribute on the entity. Plugin C removes the entity from the database. After commit the transaction an exception is caused with optimistic lock exception of the removed entity.   If this operations on the entity are executed in only one plugin, it works well.   ... C removes the entity from the database. After commit the transaction an exception is caused with optimistic lock exception of ... well.   Why the ObjectDB want to commit the changes of the entity although the entity will be removed, if we use ...

 
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 ( ...

 
issue

preUpdate-methods are called when there is no change

Dear Support Team, we ran into some difficulties with a database. When fetching a entity using the EntityManager and afterwards calling "iterator().next()" a transaction begin/commit will end up in updating the Entity even there was no change. We attached a simplified test case where only 2 reduced versions of the entities are available. But it still shows the unexpected behavior. To reproduce just run the "EntryPoint" class. ... afterwards calling "iterator().next()" a transaction begin/commit will end up in updating the Entity even there was no change. ... ; connection. getTransaction ( ) . commit ( ) ; // --> will result in a call of @PreUpdate ...

 
forum_thread

Problem with byte arrays in JDO - internal exception

This code generates an internal exception: ... ; pm. currentTransaction ( ) . commit ( ) ; pm. currentTransaction ( ... ; pm. currentTransaction ( ) . commit ( ) ; query = pm. newQuery ( ...

 
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 ) ...