Re: ERRrest session defaultEditingContext

2013-12-10 Thread Michael Kondratov
I think I've figured it out. I added createRestContext to the routes that looks if session is present and creates a new rest context with session.defaultEditingContext . Performance skyrocketed!! Michael Aspire Auctions Sent from my iPad > On Dec 10, 2013, at 14:22, Samuel Pelletier wrote: >

Re: ERRrest session defaultEditingContext

2013-12-10 Thread Samuel Pelletier
As I have done the error many times in the past, are you sure about the 15 minutes? The delay is in ms not in seconds. I now write those constant like this: EOEditingContext.setDefaultFetchTimestampLag (15*60*1000); I do not see how using the session EOEditingContext would change anything exce

Re: Qualifier against target entity?

2013-12-10 Thread Samuel Pelletier
OK, next try… If you qualify in memory, you may use the key "self" with an equals operator. ERXQ.notEquals("self", studentToRemove); If you qualify in database, I found a working solution. Add a method to your entity class that return a qualifier like this: public ERXKeyValueQualifier notMeQual

Re: ERRrest session defaultEditingContext

2013-12-10 Thread Chuck Hill
IIRC, they create a new EC per request so when the request ends there are no references to the EOs so they get garbage collected. I am surprised using the session's default changes this as it should not be retaining references to its objects (unless you have enabled that). You can also look at

Re: Qualifier against target entity?

2013-12-10 Thread Ken Anderson
Samuel, Yes, of course… but the qualifier is passed through many levels of API - so not so easy. Thanks for chiming in. Ken On Dec 10, 2013, at 8:23 AM, Samuel Pelletier wrote: > Hi, > > A simple solution is to add a line to your fetch method. > > students = fetch Students where grade > 8

Re: ERRrest session defaultEditingContext

2013-12-10 Thread Michael Kondratov
Time lag is 15 minutes. Rest routes seem to always fetch data from the database unless I manually fault objects into session's editing context. It's a huge performance hit. Sent from my iPad > On Dec 10, 2013, at 8:34, Samuel Pelletier wrote: > > Hi, > > The snapshot cache is under EOEditing

Re: ERRrest session defaultEditingContext

2013-12-10 Thread Samuel Pelletier
Hi, The snapshot cache is under EOEditingContext. Check your EOEditingContext.defaultFetchTimestampLag(), if is it very low, you are asking for refreshed objects when you fetch. Samuel Le 2013-12-09 à 13:09, Michael Kondratov a écrit : > Is there an easy way to get ERRest to use session’s d

Re: java.lang.IllegalStateException: Trying to check out a session twice in one RR loop

2013-12-10 Thread Samuel Pelletier
I second Chuck. You are trying to hide or run around another problem. The session() method should succeed, if it raise, fix the real problem instead of trying to hide it. Samuel Le 2013-12-09 à 10:29, Chuck Hill a écrit : > > On 2013-12-09 1:20 AM, "Raymond NANEON" wrote: > > Hi Samuel, >

Re: Qualifier against target entity?

2013-12-10 Thread Samuel Pelletier
Hi, A simple solution is to add a line to your fetch method. students = fetch Students where grade > 80 ; students = ERXArrayUtilities.arrayMinusObject(students, studentToRemove); <<— Line to add return students; Samuel Le 2013-12-08 à 12:44, Ken Anderson a écrit : > No, I already have an