Re: Best practices for using Cayenne's ObjectContext in a web framework?

2007-09-23 Thread Florin T.PATRASCU
Hi Andrus, Thank you for reply. Following your advice and Malcolm's -the author of the CLICK web framework-, I (almost :) got a prototype working. I am configuring my module like this: /WEB-INF/cayenne true false true

Re: Best practices for using Cayenne's ObjectContext in a web framework?

2007-09-23 Thread Andrus Adamchik
I generally use a new DataContext per thread, with a Filter binding the DataContext to request thread. I think at some point we should update the docs for 3.0 with information discussing 3 main patterns with all drawbacks and benefits. Here is a short summary: * OC per request - no sy

Re: Best practices for using Cayenne's ObjectContext in a web framework?

2007-09-23 Thread Andrus Adamchik
What about having a global OC instance per application? For read-only apps this is the way go (although switching to 3.0 is a good idea if you go this way, as 3.0 fixes a number of synchronization issues that affect shared context use). For read/ write apps you can't do that. Also, is it

Re: Optimize cascade deletes

2007-09-23 Thread Giulio Cesare Solaroli
Hello, I have collected a few more data, as suggested by Aristedes. On 9/23/07, Giulio Cesare Solaroli <[EMAIL PROTECTED]> wrote: > On 9/23/07, Aristedes Maniatis <[EMAIL PROTECTED]> wrote: > > > > On 23/09/2007, at 5:38 PM, Giulio Cesare Solaroli wrote: > > > > > log4j.logger.org.apache.cayenne=

Re: Best practices for using Cayenne's ObjectContext in a web framework?

2007-09-23 Thread Malcolm Edgar
Hi Florin, I generally use a new DataContext per thread, with a Filter binding the DataContext to request thread. Please see the attached example. regards Malcolm Edgar http://click.sourceforge.net On 9/23/07, Florin T.PATRASCU <[EMAIL PROTECTED]> wrote: > > Hi there, > > I am trying to add Cay

Re: Optimize cascade deletes

2007-09-23 Thread Giulio Cesare Solaroli
On 9/23/07, Aristedes Maniatis <[EMAIL PROTECTED]> wrote: > > On 23/09/2007, at 5:38 PM, Giulio Cesare Solaroli wrote: > > > log4j.logger.org.apache.cayenne=ERROR > > log4j.logger.org.apache.cayenne.access.QueryLogger=DEBUG > > > > > > Is there anything going on on the Cayenne code between the last

Best practices for using Cayenne's ObjectContext in a web framework?

2007-09-23 Thread Florin T.PATRASCU
Hi there, I am trying to add Cayenne support to the JPublish web framework (http://code.google.com/p/jpublish/) and being very new to Cayenne I would like, if possible, to find which is the best practice for obtaining and using the OC? I browsed the threads here and most of the informatio

Re: Optimize cascade deletes

2007-09-23 Thread Aristedes Maniatis
On 23/09/2007, at 5:38 PM, Giulio Cesare Solaroli wrote: log4j.logger.org.apache.cayenne=ERROR log4j.logger.org.apache.cayenne.access.QueryLogger=DEBUG Is there anything going on on the Cayenne code between the last [batch bind:xxx] log and the "updated" log? Well, you could always try: lo

Re: Transactions , Primary Keys

2007-09-23 Thread Aristedes Maniatis
On 23/09/2007, at 2:23 PM, Philip Copeland wrote: Did you have an issue committing every "several thousand records". What would you do if it failed at that stage - did you figure out a way to resume again at a known point? Handling large imports is never easy. Initially we had some memory i

Re: Optimize cascade deletes

2007-09-23 Thread Giulio Cesare Solaroli
Hello Aristedes, On 9/23/07, Aristedes Maniatis <[EMAIL PROTECTED]> wrote: > > On 22/09/2007, at 11:41 PM, Giulio Cesare Solaroli wrote: > > > 15 seconds are a lot of time, but they would be bearable. The problem > > is that I suppose this time will gradually increase with the growth of > > the nu