Re: Storing DataObjects in Session

2008-05-09 Thread John Emmanuel
Thank you very much Andrus. On Fri, May 9, 2008 at 4:43 PM, Andrus Adamchik <[EMAIL PROTECTED]> wrote: > > On May 9, 2008, at 8:31 AM, John Emmanuel wrote: > > >> I would like to know if it is ok to store DataObjects in session. >> > > Yes, as long as the DataContext that this object belongs to

Re: many-to-many mapping resulting in incomplete SQL queries

2008-05-09 Thread Daniel Doppmeier
Hi! I'm sorry I made a mistake there. When I was posting the code I was leaving out some lines of comment and I seem to have lost one line of code meanwhile. So here is the (slightly changed) code again. This time free of typing errors, I hope: DataContext context = DataContext.creat

chaining and chunking

2008-05-09 Thread Dan Morgan
I know that you can chunk as follows: #chunk($somevalue) A = $somevalue #end but can you chunk like: #chunk($somevalue > 10) A > $somevalue #end Thanks, Daniel L. Morgan EMail : <[EMAIL PROTECTED]>

Re: how can I use two different databases in one web application?

2008-05-09 Thread Michael Gentry
I just did a quick test with one DataDomain, 2 DataNodes, 2 DataMaps. One DataNode connecting to Derby and the other connecting to MySQL. I was able to insert/select from both databases without an issue. Admittedly, I'm using Cayenne 3, but I don't think that should be a problem. It really sounds

Re: many-to-many mapping resulting in incomplete SQL queries

2008-05-09 Thread Michael Gentry
Hi Daniel, I'm not sure if you've solved your problem yet, but from the code you posted, I don't see where you established any relationship between book1 and author1/author2. You had objects with no relationship defined, so you can't actually remove book1 from author1. /dev/mrg On Tue, May 6, 2

RE: how can I use two different databases in one web application?

2008-05-09 Thread Garcia Corral, Josep
Both of them are correctly assigned. Here's the cayenne.xml contents: -Mensaje original- De: Michael Gentry [mailto:[EMAIL PROTECTED] Enviado el: viernes, 09 de mayo de 2008

Re: how can I use two different databases in one web application?

2008-05-09 Thread Michael Gentry
Make sure your DataMaps are assigned to DataNodes. In Cayenne Modeler, select each DataMap and look at the DataNode pulldown list (under the DataMap Configuration sectoin) and make sure it is assigned to the right DataNode. On Fri, May 9, 2008 at 10:31 AM, Garcia Corral, Josep <[EMAIL PROTECTED]>

RE: how can I use two different databases in one web application?

2008-05-09 Thread Garcia Corral, Josep
Thanks for your reply. I tried your suggestion: HttpSession session = req.getSession(); DataContext context = ServletUtil.getSessionContext(session); Expression qualifier = Expression.fromString(some_condition_for_table_A); SelectQuery select = new SelectQuery(A.class, qualifier);

Re: how can I use two different databases in one web application?

2008-05-09 Thread Michael Gentry
I suspect you are wanting to access both databases at the same time and within the same DataContext? If so, try your second option (one DataDomain, two DataMaps, two DataNodes -- one DataMap assigned to your Oracle DataNode and the other DataMap assigned to your MySQL DataNode). Then create a Dat

how can I use two different databases in one web application?

2008-05-09 Thread Garcia Corral, Josep
Hello, I am using the last stable version of Cayenne: 2.0.4. The situation is: Database 1: oracle, with tables A, B Database 2: mysql, with tables C, D, E First question is: what's the best way to define this in a Cayenne Project? First_Domain: First_DomainMap

Re: Storing DataObjects in Session

2008-05-09 Thread Andrus Adamchik
On May 9, 2008, at 8:31 AM, John Emmanuel wrote: I would like to know if it is ok to store DataObjects in session. Yes, as long as the DataContext that this object belongs to is also in the session scope. Judging from the stack trace, it is in your case. I stored an employee dataobject