RelationshipQuery

2010-04-22 Thread Joe Baldwin
Is there any way to add a qualifier to the RelationshipQuery? (I am trying to create a custom method that essentially returns a qualified RelationshipQuery result set)

different ObjectContext...

2010-04-22 Thread Arnaud Garcia
Hello, (lot of questions today ;-) I have a curious error on my site (wicket+cayenne). Cannot set object as destination of relationship toAdresse because it is in a different ObjectContext at org.apache.cayenne.CayenneDataObject.willConnect(CayenneDataObject.java:344) at org.apache.cayenn

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Michael Gentry
In my case I had a common superclass with a getDataContext() method which would retrieve the one stored/bound to the current thread by the filter. Here is the relevant code I used: private DataContext dataContext; public DataContext getDataContext() { if (dataContext == null) dataCo

Re: Cayenne withing MDB in Jboss

2010-04-22 Thread Michael Gentry
I was using Cayenne with a Tapestry 5 web-based application in JBoss. mrg On Thu, Apr 22, 2010 at 11:51 AM, Marco Gattei wrote: > I've managed to get the wohole story go in Jboss 4.2.3 and Jboss 4.0.5. > Cayenne seems to work fine. > > In your case, Cayenne was runnng from web-tier or was in eju

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Joe Baldwin
Arnaud, Michael is the expert. But my understanding is that the current recommended procedure is to message the BaseContext. Example: ObjectContext oc = BaseContext.getThreadObjectContext(); ... create a query List list = oc.performQuery(query); Joe On Apr 22, 2010, at

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Arnaud Garcia
thanks for answers... so, Yes I am doing a Webapp and I have in my web.xml the cayenne filter I am not sure to understand what is the good way to retrieve the DataContext... Each time I need it I thought I just need to do (DataContext) DataContext.getThreadObjectContext(); So now I just have

Re: Cayenne withing MDB in Jboss

2010-04-22 Thread Marco Gattei
I've managed to get the wohole story go in Jboss 4.2.3 and Jboss 4.0.5. Cayenne seems to work fine. In your case, Cayenne was runnng from web-tier or was in ejub tier ? Marco Michael Gentry ha scritto: I've ran Cayenne (along with Tapestry 5) in JBoss (4.2.3) successfully before. I don't know

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Joe Baldwin
Arnaud, I read right past the "Wicket" reference; it appears that you are creating a webapp. Michael is correct. The cayenne filter creates and binds the ObjectContext for you in this case. Sorry for the confusion, Joe On Apr 22, 2010, at 10:13 AM, Michael Gentry wrote: > Did you configure

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Joe Baldwin
Arnaud, The recommendation has been to transition to using the BaseContext in place of the older DataContext class methods. (Ironically, it appears that the Cayenne 3.x docs have not all been updated and so in some places they show examples of BaseContext and some show examples of DataContext.

Re: cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Michael Gentry
Did you configure your web.xml file to use the Cayenne web filter? In my application (which is Tapestry, but should apply to Wicket, I think) I have: Cayenne Filter org.apache.cayenne.conf.WebApplicationContextFilter Cayenne Filter /* mrg On

cayenne wicket unit test => Current thread has no bound ObjectContext

2010-04-22 Thread Arnaud Garcia
Hello, I am working on a Wicket Cayenne application and when I launch the tests I have an error when the DataContext is initialized: This line, DataContext ctxt = (DataContext) DataContext.getThreadObjectContext(); throws an java.lang.IllegalStateException: Current thread has no bound ObjectCon

Re: Cayenne withing MDB in Jboss

2010-04-22 Thread Michael Gentry
I've ran Cayenne (along with Tapestry 5) in JBoss (4.2.3) successfully before. I don't know about your MDB scenario, but Cayenne certainly can work in JBoss. mrg On Thu, Apr 22, 2010 at 6:42 AM, Marco Gattei wrote: > Hi everyone. > > I've written a java standalone program which uses Cayenne to

Cayenne withing MDB in Jboss

2010-04-22 Thread Marco Gattei
Hi everyone. I've written a java standalone program which uses Cayenne to connect to a DB and perform some operations: reading from table, calculating , inserting result into another table. Now need arise to start this program not from cli, but from remote. I was thing about packing the app