Re: org.springframework.dao.InvalidDataAccessApiUsageException: Encountered unmanaged object

2007-11-10 Thread klaasjan elzinga
Did you try putting the Cascade persist and cascade merge on the item->header relation? I think the exception means that the item is being persisted and encounters a not persisted (managed) header. Or try by calling persist(header) and after that the persist(item). KlaasJan On Nov 9, 2007 8:06 PM

setting up transactions

2007-11-10 Thread Adam Hardy
I need transactions in my webapp using the OpenSessionInView filter pattern to enable use of entities in my JSPs. I am not using an EJB3 container, and I am restricting my use of Spring, or at least trying to, to the IoC and transaction manager (for XML transaction configuration). Is there a

Re: setting up transactions

2007-11-10 Thread Wes Wannemacher
Adam, I'm interested in this as well, I'm trying to build a Struts2 app to be distributed that provides a "best-practices" example of JPA in struts2 (a refactoring of the struts-mailreader for those who are familiar with it). I want to keep Spring out, so I was thinking of adapting the OpenSession

Re: setting up transactions

2007-11-10 Thread Adam Hardy
So I'm not the only one then. I just hit another issue at the data access layer/DAOs. According to the OpenJPA docs, the idiomatic design for the data access layer is to use an injectable Entity Manager Factory which provides a fresh Entity Manager each time. if openjpa.TransactionMode=local,

How to set result lists permanently to be non read-only

2007-11-10 Thread Miroslav Nachev
Hi, I try to use OpenJPA together with NetBeans 6 and I have the following exception: "java.lang.UnsupportedOperationException: Result lists are read-only." This exception is not thrown when I am using TopLink. Can you suggest me how to set permanently all result lists to be writable by default?

Re: setting up transactions

2007-11-10 Thread Patrick Linskey
Hi, > if openjpa.TransactionMode=local, we have to deal with the transactions in the > data access layer. But this is not what I want to do - I'd like my 'non-EJB > transaction manager of choice' (currently Spring) to manage them. There are a few different concepts at play here. One is the transa

Re: How to set result lists permanently to be non read-only

2007-11-10 Thread Patrick Linskey
Can you post the full stack trace? -Patrick On Nov 10, 2007 12:38 PM, Miroslav Nachev <[EMAIL PROTECTED]> wrote: > Hi, > > I try to use OpenJPA together with NetBeans 6 and I have the following > exception: > "java.lang.UnsupportedOperationException: Result lists are read-only." > > This exceptio

Re: subList on Query.getResultList() throws UnsupportedOperationException

2007-11-10 Thread Michael Terrington
For the benefit of the list (since I've had e-mails asking if I solved it), the workaround I used was to copy the list using new ArrayList(openjpaList) and called subList on that. Michael Terrington wrote: Using OpenJPA 1.0.0 I'm getting an exception when I try to use subList on a result list.

Re: setting up transactions

2007-11-10 Thread Adam Hardy
Patrick Linskey on 10/11/07 21:15, wrote: if openjpa.TransactionMode=local, we have to deal with the transactions in the data access layer. But this is not what I want to do - I'd like my 'non-EJB transaction manager of choice' (currently Spring) to manage them. There are a few different concep

Re: setting up transactions

2007-11-10 Thread Patrick Linskey
> No, I'd rather keep Spring away from managing the persistence unit. There's > alot > I want to be able to do with it that doesn't fit in with the way Spring > handles > it. The DAO abstract superclass from Spring is quite restrictive, and combined > with the testing, it sucks the unwary into co

Re: NoSuchMethodError running PCEnhancerTask

2007-11-10 Thread Patrick Linskey
Hi, Maybe your commons-lang jar is an older version? -Patrick On Nov 8, 2007 12:22 PM, pmw <[EMAIL PROTECTED]> wrote: > > I'm trying to run the PCEnhancerTask but keep getting strange errors. I have > included all jars from the openjpa 1.0.0 release in the path for the taskdef > and all but it s