About commit

api-jdo

setRollbackOnly()

Sets the rollback-only status of the transaction to true.(Method of javax.jdo.Transaction)

 
forum_thread

How to do multithreading with embedded ObjectDB

Hi, I've tried to implement a counter with ObjectDB, but the following code doesn't work as expected: ... ; em. getTransaction ( ) . commit ( ) ; em. close ( ) ; ... em. getTransaction ( ) . commit ( ) ; em. close ( ...

 
api-jdo

javax.jdo.annotations.ForeignKey

Annotation for a database foreign-key.(Annotation of JDO)

 
forum_thread

Spring Transactions (@Transactional) within ObjectDB

Hi, We are using OBD with Spring and transactions are managed by Spring. Our spring service interfaces take list of objects and persist them and the interface service is marked as @Transactional. We iterate through the list apply business validations and persist them one by one in a loop. ( Using Spring Data) We have noticed that in a loop 1st object is persisted and then we if lookup the same object we don't get it back on lookup. ... same transaction. It is only available after transaction commit. Ideally the lookup is also part of same transaction so it should be ... are always available in the same transaction also before commit. But it is unclear which operations exactly are performed by ...

 
forum_thread

Attempt to remove a detached entity object (error 613)

Hello, that a strange error for me ... I have a detached object in my Java code and i just wanted to merge it ... Unfortunatly, i get this error : Failed to commit transaction: Attempt to remove a detached entity object (error 613)      at com.objectdb.jpa.EMImpl.commit(EMImpl.java:290) We see in this stack trace that is a commit operation, all right ... So why does it try to remove the object ... ? ... Unfortunatly, i get this error : Failed to commit transaction: Attempt to remove a detached entity object (error 613)      at com.objectdb.jpa.EMImpl.commit(EMImpl.java:290) We see in this stack trace that is a commit ...

 
forum_thread

Field not persisted in abstract class with two level of nesting

Hi, I have a field (embedded TZ1) which is not persisted in class MHD1 (TZ1  extends AS and AS extends ATT). But it seems to work fine when I skip the AS and make TZ2 extend directly from ATT. Here is an example code MHD1 ... ; em. getTransaction ( ) . commit ( ) ; em. clear ( ) ; ... ; em. getTransaction ( ) . commit ( ) ; em. clear ( ) ; ...

 
forum_thread

find() delay

Hi, I tried objectdb in following steps: 1, for 1 to 30 {trans.begin(); create typeC o; em.persist(o); trans.commit();} 2, for 1 to 30 {p = em.find(typeC.class, i); print(p)} So simple a test, there is no result in one go; I have to disable step 1 and run again, then Step 2 output the expected results. I tried em.flush(), em.clear(), etc.. that do not work. Any idea? TIA ... to 30 {trans.begin(); create typeC o; em.persist(o); trans.commit();} 2, for 1 to 30 {p = em.find(typeC.class, i); print(p)} ... trans.begin(); create typeC o; em.persist(o); trans.commit(); 2. Query q =  em.createQuery("select e from typeC e"); ...

 
forum_thread

Left join fetch behaviour doesn't retrieve children?

Hello support, I'm a little bit confused about a left join fetch behaviour. In this test case, i try to fetch my 3 children using a left join fetch. But my collection is null after closing the em. It was expected to be fetched before closing the em, no ? In fact, that is the objective of the fetch purpose (i guess ?). ... merged em. getTransaction ( ) . commit ( ) ; em. clear ( ) ; ... well merged em. getTransaction ( ) . commit ( ) ; em. clear ( ) ; em. ...

 
forum_thread

On ensuring ID available after persist

This reports on a possible solution to a common problem: I was trialling ObjectDB on an existing, functioning, large JavaEE/JPA web application, which until now had used EclipseLink+MySQL and then Oracle+MySQL. On trying it out on ObjectDB I hit a problem with my very extensive entity wiring code, which relies on an "external" entity object having a non-null id after it has been passed to EntityManager.persist, thus: ... a new entity object is   persisted (i.e. before commit). This may be useful when the primary key value is needed earlier. ... round trip to the server. By postponing ID allocation to commit or flush - multiple IDs for multiple objects can be allocated ...

 
issue

java.lang.ClassCastException: com.objectdb.o.SCU cannot be cast to com.objectdb.o.PRU

Error in production urgent [2017-05-19 13:34:09 #14 server] ... ERROR cl.intelidata.PcsIndexarCsv.main(92): Failed to commit transaction: com.objectdb.o.SCU cannot be cast to com.objectdb.o.PRU ... 2.7.1] javax.persistence.RollbackException Failed to commit transaction: com.objectdb.o.SCU cannot be cast to com.objectdb.o.PRU ...