About Persistence Context

api-jpa

contains(entity)

Check if the instance is a managed entity instance belonging to the current persistence context.(Method of javax.persistence.EntityManager)

 
issue

Integration with Java EE (JPA 1.0)

ObjectDB can be used in both Java EE and Java SE by using application managed EntityManager. Support of container managed EntityManager and integration with the JTA (Java Transaction API) is not implemented yet.... SE by using application managed EntityManager javax.persistence.EntityManager JPA interface Interface used to interact with the persistence context. See JavaDoc Reference Page... . Support of container ...

 
tutorial

Step 2: Define a JPA Entity Class

Explains how to define a JPA entity class in a NetBeans Web Application.... import java. sql . Date ; import javax. persistence . Entity ; import javax. persistence . GeneratedValue ... despite the warning. The next step is adding a context listener class that will manage a JPA's EntityManagerFactory ...

 
issue

Once served to JSF page via @EJB query bean, many list fields are null (but same query ok after fresh persist in @PostConstruct)

I have marked this as CRITICAL because although there probably is no database integrity problem, the inability to robustly query relationship fields in a web application renders the ObjectDB system seemingly useless. objectdb-2.2.5_10 NetbeansIDE6.9.1 Glassfish3.01 client-server mode. odb file written to db-files/greendesk/greendesk.odb (see persistence.xml), copy of odb output attached. ... odb file written to db-files/greendesk/greendesk.odb (see persistence.xml), copy of odb output attached. Sorry this is a complex ... completes - all the entity objects in the persistence context are detached. Because the ownedElements relationship is defined as ...

 
forum_thread

EntityManager JPA or JDO impl and different behavior

Hi, I have an issue with the EntityManager. My persistance XML looks like: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> ... = "1.0" encoding = "UTF-8" ?> <persistence version = "2.0" xmlns = "http://java.sun.com/xml/ns/persistence" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
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 ?). ... java. util . Set ;   import javax. persistence . CascadeType ; import javax. persistence . ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

Need help to make this test work and define proper annotations for entities Lists

Hi, I can't get this simple test case to work, i know it is probably due to the lack of proper annotations on entities list, could anyone help me to define them? NB in this test case I didn't set all entities methods for the sake of clarity, also in actual application no field are public nor static and no entity is static.    ... import java. util . List ; import javax. persistence . Entity ; import javax. persistence . ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
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. ... java. util . List ;   import javax. persistence . Basic ; import javax. persistence . Entity ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
issue

Strange Error with Criteria API and Sorting

We're creating a simple selection (distinct) including an order clause. When watching the created criteria in debugger we get the correct expression: SELECT DISTINCT $1 FROM MyEntity $1 WHERE ((TYPE($1)=class test.MyEntity)) ORDER BY UPPER($1.name) DESC You can see that in the order by there's correctly a "$1" var. Running this (without the type thing before) in the explorer correctly returns the sorted results. However, running this with the criteria API produces this error: ... java. util . List ;   import javax. persistence . Entity ; import javax. persistence . ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...

 
forum_thread

Database(*.odb) file size on disk

Hello, we have questions about the file size of ObjectDB database on disk. Can you tell us something about how the deleting of entities affects the size of *.odb files on disk? -Will the released memory always used by new entities? -Will be the database file automatically reduced?   We have created a small test, in which we create and delete entities. It looks like that the released memory are reused but the the file not resized. The database is at the end empty again, but larger than the initial size. ... java. util . List ;   import javax. persistence . Basic ; import javax. persistence . ... Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell ...