About EntityManager

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; ... ( "ODB.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ... to work as expected. The entity object is cached in the EntityManager  as a managed entity object and it is returned with the ...

 
forum_thread

Problem on JPA Merge Entity.

Hello, I have a problem with the EntityManager.merge() function. I set a property value of an entity (statement) with an other entity (newSingleConstraint). newSingleValue is already persisted. I do this myself (no use of cascade because sometimes the newSingleValue is already in database).   The statement update don't throw exception. And when i try to reload statement the value i have set before is a null value. I check with the Explorer, the statement has a null value on the property and the newSingleValue is present.... Hello, I have a problem with the EntityManager.merge() function. I set a property value of an entity ... @ PersistenceContext private EntityManager entityManager ;   public void ...

 
forum_thread

Insertion Speed Rate and Batch Load

1. I got about 10K inserts / second, is it normal? I would expect more than that, like close to 100K/second. I can definitely do 80K inserts/seconds on Oracle with batch insert on table with one primary key. 2. Is batch update/insert operation supported? I attached the files. ... thread uses a separate transaction, and moreover, a new EntityManager  per stored entity object. A batch load should reuse the EntityManager and persist a large number of objects per transaction. This is ...

 
manual

JPA Criteria API Queries

Explains how to use the JPA Criteria API (CriteriaBuilder, CriteriaQuery, etc.) to build JPQL like queries.... em. getCriteriaBuilder getCriteriaBuilder() EntityManager's method Return an instance of CriteriaBuilder for the ... Reference Page... method or by the  EntityManager javax.persistence.EntityManager JPA interface ...

 
issue

Unexpected exception (Error 990) com.objectdb.o.InternalException

Hello, we get an exception if we use Enhanced Entities. With not enhanced Entities we get no error. ... ) ; EntityManager em = emf. createEntityManager ( ) ; ... ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
issue

Threaded Test - Failed to commit transaction: Unexpected internal exception

Hi I'm trying to create a simple producer-consumer queue scenario but am getting the followin exception: ... put ( Point p ) { EntityManager em = _emf. createEntityManager ( ) ; ... Point take ( ) { EntityManager em = _emf. createEntityManager ( ) ; ...

 
forum_thread

Finding out the JPA provider

Do you have any preferred way of finding out whether ObjectDb is my EntityManager's JPA Provider? I know there are problems with using getDelegate ( http://weblogs.java.net/blog/ss141213/archive/2009/05/be_careful_whil.html ) but on the other hand unwrap is not very portable ( https://forums.oracle.com/forums/thread.jspa?threadID=2149162 ). It would be nice if the <provider> element of the PeristenceUnit were visible in one of the Properties sets returned by the EntityManager and EntityManagerFactory, but its not.   ... any preferred way of finding out whether ObjectDb is my EntityManager's JPA Provider? I know there are problems with using ... were visible in one of the Properties sets returned by the EntityManager and EntityManagerFactory, but its not. So I am left with ...

 
forum_thread

Entity has be persistended,but query not fetched?

I create a new entity T newT and persistend it,then I create a query "select t from T t" to fetch all T entities.But  then the newT is not contain in the query result. Why? ... ( "$objectdb/flush.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ... } Maybe you are using a different EntityManager for the query? Updates can only be visible before ...

 
forum_thread

Not able to update records

Hi,   I am tring to update the simple object by using Update query by i am getting following exception [ObjectDB 2.4.4_15] javax.persistence.TransactionRequiredException Attempt to run update query when no transaction is active (error 611) at com.objectdb.jpa.JpaQuery.executeUpdate(JpaQuery.java:758) Following is the code i am executing   ...   EntityManager em = emFactory.createEntityManager();   Query query = ... . DATABASE_FILE_CLIENTSERVER_MODE ) ; EntityManager em = emFactory. createEntityManager ( ) ...

 
forum_thread

Wrong data stored in time only fields

This may be related to the fix for the problem described in this thread: Wrong data stored in date only fields. The object and its date and time fields are the same as in the referenced thread. Except we are using ObjectDB 2.6.4_08, the system time zone is set to EST and both the OS and JVM are using the 2015g time zone data. ... . Entity ; import javax. persistence . EntityManager ; import javax. persistence . ... ) ; EntityManager em = emf. createEntityManager ( ) ; ...