Re: ERXBatchingDisplayGroup and batch size
Re: ERXBatchingDisplayGroup and batch size
- Subject: Re: ERXBatchingDisplayGroup and batch size
- From: Chuck Hill <email@hidden>
- Date: Thu, 18 Oct 2012 15:45:33 -0700
On 2012-10-18, at 3:30 PM, Louis Demers wrote:
> Wow,
> 1) turned on sql loggin (which I hsould have tought of by mayself , head in shame)
LOL I thought that would be your reaction. :-)
> 2) setup the crash
> 3) cut and pasted the sql and now crashed Mail because the request was so f****** big ! here is the start
<snip>
>
> 200:18574(id), 201:6284(id), 202:10381(id), 203:6282(id), 204:6283(id), 205:10376(id), 206:6281(id), ..........
>
> that line has 2059805 characters in it !!!!
My guess is that the line is too long for Postgres and is causing a buffer overflow or something. That IS a rather long line. :-)
So the next interesting question is,
>>> If i first put a small number, then I can ask any number including 0 and it works...
what SQL is sent if you set the batch size to 10 and then to 0"? My guess is that it is not actually fetching everything in that case.
Chuck
> here is my appendToResponse where I setup the displaygroup
>
>
> EOQualifier eoq;
> eoq = ERXQ.equals(Transaction.TRANSACTION_TYPE_KEY, standardTransactionType);
>
> if (dateBefore != null)
> eoq = ERXQ.and(eoq, ERXQ.lessThan(Transaction.DATE_END_KEY, dateBefore));
> if (dateAfter != null)
> eoq = ERXQ.and(eoq, ERXQ.greaterThan(Transaction.DATE_END_KEY, dateAfter));
> if (selectedProject != null)
> eoq = ERXQ.and(eoq, ERXQ.equals(Transaction.PROJECT_KEY, selectedProject));
>
> fs = new ERXFetchSpecification<Transaction>(Transaction.ENTITY_NAME, eoq, null);
> ds.setFetchSpecification(fs);
> dg.setDataSource(ds);
>
> // log.debug("sort: " + dg.sortOrderings());
> dg.fetch();
>
> super.appendToResponse(response, context);
>
>
>
> On 2012-10-18, at 18:14 , Chuck Hill <email@hidden> wrote:
>
>> What is the SQL that is causing that exception?
>>
>> Chuck
>>
>>
>> On 2012-10-18, at 3:04 PM, Louis Demers wrote:
>>
>>> Hi,
>>>
>>> Converted some pages from WODisplayGroup to use ERXBatchingDisplayGroup. Formerly, one could enter a batchsize of 0 to get all the objects. Now when i do that, or a very large number, I get an unrecoverable exception that forces me to restart the applications and the database (PostgreSQL). If i first put a small number, then I can ask any number including 0 and it works...
>>>
>>>
>>> The exeption I get is Oct 18 17:58:11 INFO er.transaction.adaptor.Exceptions - Database Exception occured: This connection has been closed.at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:712)
>>> at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:729)
>>> at com.webobjects.jdbcadaptor.JDBCContext.rollbackTransaction(JDBCContext.java:488)
>>> at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:340)
>>> at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:296)
>>> at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:220)
>>> at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897)
>>> at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234)
>>> at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
>>> at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
>>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
>>> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1306)
>>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
>>> at er.extensions.eof.ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(ERXEOGlobalIDUtilities.java:290)
>>> at er.extensions.eof.ERXEOControlUtilities.objectsInRange(ERXEOControlUtilities.java:662)
>>> at er.extensions.batching.ERXBatchingDisplayGroup.objectsInRange(ERXBatchingDisplayGroup.java:384)
>>> at er.extensions.batching.ERXBatchingDisplayGroup.refetch(ERXBatchingDisplayGroup.java:423)
>>> at er.extensions.batching.ERXBatchingDisplayGroup.refetchIfNecessary(ERXBatchingDisplayGroup.java:132)
>>> at er.extensions.batching.ERXBatchingDisplayGroup.hasMultipleBatches(ERXBatchingDisplayGroup.java:229)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
>>> at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
>>> at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
>>> at com.webobjects.appserver.WODisplayGroup.valueForKey(WODisplayGroup.java:3122)
>>> at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
>>> at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
>>> at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:151)
>>> at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
>>> at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
>>> at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
>>> at com.webobjects.appserver.WOAssociation.booleanValueInComponent(WOAssociation.java:276)
>>>
>>> ....
>>>
>>> Louis Demers eng.
>>> Vice-President, Co-Founder
>>> Obzerv Technologies Inc.
>>> 400 Jean Lesage, suite 201
>>> Quebec, QC, Canada
>>> G1K 8W1
>>> T 418.524.3522
>>> F 418.524.6745
>>> www.obzerv.com
>>>
>>>
>>>
>>>
>>> Louis Demers eng.
>>> www.obzerv.com
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>> --
>> Chuck Hill Senior Consultant / VP Development
>>
>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
>> http://www.global-village.net/gvc/practical_webobjects
>>
>> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>>
>>
>>
>>
>>
>>
>>
>>
>
> Louis Demers eng.
> Vice-President, Co-Founder
> Obzerv Technologies Inc.
> 400 Jean Lesage, suite 201
> Quebec, QC, Canada
> G1K 8W1
> T 418.524.3522
> F 418.524.6745
> www.obzerv.com
>
>
>
>
> Louis Demers eng.
> www.obzerv.com
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects
Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden