About EntityManager

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

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

 
issue

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

Environment: Mac OS X JVM: Java 1.8 u 20 Steps to reproduce Use the following classes: /** Account Class **/ ... = new Account ( ) ;   entityManager. persist ( account ) ;   entityManager. flush ( ) ;   Project project = ...

 
forum_thread

Help with 'not like/lower' query

Hi again,   Honestly, I'm fairly new with JPA2 Criteria queries - but as far as code effort goes, it has saved me a bit of pain. I'm writing a dynamic query builder (only 1 level deep for basic entities) - but  even though I get most queries to work, I am getting the following error. This is using Criteria with a combination of LOWER/UPPER - NOT LIKE: ... . Entity ; import javax. persistence . EntityManager ; import javax. persistence . ... "$objectdb/db/test.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
forum_thread

ODB tries to create log files inside its own jar on Win7

I sent a demo of an app I've been developing on Linux to some Windows 7 users, and they were unable to run it.  The stack traces they sent me indicated that ODB was trying to create its log files inside objectdb.jar, which was inside the executable jar packaged by Eclipse.  Here's the end of the stack trace: ... test ;   import javax. persistence . EntityManager ; import javax. persistence . ... ( "objectdb:test.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
issue

objectdb-2.6.9_06: Extended Persistence Context fails: 'Attempt to begin a new transaction when a transaction is active'

objectdb-2.6.9_01 NetBeans8.1+Glassfish4.1.1 Mac OS X Possibly related: How to Use a SF with extended Persistence Context? Test mini web app at: https://www.webel.com.au/downloads/objectdb/GreensoftObjectdbTestWebMini3683.2016-09-29.tgz ... . EXTENDED ) //! protected EntityManager em ;   /* public ExtProjectBuilder() { ... . EXTENDED ) //! protected EntityManager em ;   /* public ExtProjectBuilder() { ...

 
forum_thread

Null enums and IS (NOT) NULL: NullPointerException

Hello. I'm getting NullPointerException when adding %enum field% IS (NOT) NULL or == (!=) NULL in WHERE clause. The same exception using CriteriaQuery. ... unitName = "my-pu" ) private EntityManager entityManager ;   public void persist ( Object o ...

 
manual

Query Parameters in JPA

Explains how to use parameters (named parameters and ordinal parameters) in JPA queries.... public Country getCountryByName ( EntityManager javax.persistence.EntityManager JPA interface Interface used to interact with the ... createQuery createQuery(qlString, resultClass) EntityManager's method Create an instance of TypedQuery for executing a ...

 
forum_thread

NullPointerException while setting a new property value

Hello, we are using ObjectDB version 2.4.4 and we are unable to resolve following NPE on enhanced entity: java.lang.NullPointerException at com.objectdb.o.ENT.beforeModifyMember(ENT.java:1099) at model.PluginMetaData.__odbSet_maxAllowedDownloads(PluginMetaData.java:1) at model.PluginMetaData.setMaxAllowedDownloads(PluginMetaData.java:268) at model.PluginMetaData.setPluginDescriptor(PluginMetaData.java:94) PluginMetaData looks like this (nothing extraordinary, no relationship to other @entities): ... entityCollection ) { final EntityManager em = getEntityManager ( ) ; ... JPA with multi threads each thread should have its own EntityManager and entities. According to the JPA specification: "An ...

 
forum_thread

UserException or JDOUserException

I received an Exception:  "com.objectdb.o.UserException: Attempt to obtain a transaction using a closed EntityManager" Should I ever see a "UserException"?  Should it have been converted to a "JDOUserException" and that should have been returned instead? ... Attempt to obtain a transaction using a closed EntityManager" Should I ever see a "UserException"?  Should it ... : Attempt to obtain a transaction using a closed EntityManager at com. objectdb . o . MSG . d ( MSG. java ...