Re: SQL select when merging detached entity

2007-09-21 Thread Evgeny Shepelyuk
18.09.07 в 11:30 Gene Woo в своём письме писал(а): why do you want to disable SELECT query? in my opinion, SELECT is a very important step for merging a detached object. If no SELECT, how does JPA know it's a detached object or a new object? Acxtually it can check @Id annotated field to check

Re: Queries when creating EntityManager

2007-09-20 Thread Evgeny Shepelyuk
20.09.07 в 12:02 Patrick Linskey в своём письме писал(а): Hi, Can you post your current persistence.xml file? http://java.sun.com/xml/ns/persistence"; version="1.0"> org.apache.openjpa.persistence.PersistenceProviderImpl . my entities value="jdbc:postgresql://localhost:5432/test"

Queries when creating EntityManager

2007-09-20 Thread Evgeny Shepelyuk
Hello! Im using OpenJPA with Spring transactional management and EntityManager injection to DAO under Postgresql 8.2.1 Seems when new EntityManager is created those queries are executing to database SELECT t.typlen FROM pg_catalog.pg_type t, pg_catalog.pg_namespace n WHERE t.typ

SQL select when merging detached entity

2007-09-18 Thread Evgeny Shepelyuk
Hello ! Is there any way to disable SELECT query to database when merging detached entity into EntityManager ? Im doing smth like ... getting user entity and closing EntityManager user.setFirstName("222"); em = emf.createEntityManager(); em.getTransaction().begin(); user = em.mer

Re: Lazy load for detached entities

2007-09-12 Thread Evgeny Shepelyuk
The idea is that Toplink JPA supports that feature. OpenJPA - no. Maybe this can be done as some configurable behaviour ? They do, but really, all that they are doing is hiding the open EM. In other words, the objects are not actually really detached yet. What type of application are you buildi

Re: openjpa.Enhance message

2007-09-11 Thread Evgeny Shepelyuk
Hi, finally I could run my example using Java 6 with no problems, but, at runtime I get this message: test_jpa INFO [main] openjpa.Enhance - Creating subclass for "[class test.Person, class test.Sex]". This means that your application will be less efficient and will consume more memory than

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hi, Lazy loading is not available for detached entities -- by definition, they are no longer associated with the database. You can, however, control whether OpenJPA returns null or throws an exception when an unloaded field is accessed. If you want to be able to lazily access a field after a tr

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
This is of course the manual way but fetch-groups are smarter in my oppinion But i am using Kodo and it might be that fetch groups are not supported in openJPA but i think it is Yes fetch groups are suppored in OpenJPA. So can u give some basic use case for using fetch groups ? -- Be

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
11.09.07 в 12:17 Gene Wu в своём письме писал(а): to support lazy load base on your code. Just change the order. Load the object before you close em(this is the context needed for lazy load). EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu1"); EntityManager em = emf.crea

Re: Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hi, i am also working in a highly detached environment because of auto- detachment when giving data to a different layer (questionable approach i know, but i dont need to inject persistenceManagers everywhere then). So i also have this "lazy loading" problem. I circumvent this kind of issue by us

Lazy load for detached entities

2007-09-11 Thread Evgeny Shepelyuk
Hello ! Is there any way to access fields marked with lazy fetching for detached entities. Im having some code like @Entity @Table(schema = "public", name = "users") public class UsersEntity { private Integer userid; private List orders; @OneToMany(cascade = CascadeT