WARNING : I know nothing about sql ...

As I thought,  here is the beginning when the batchsize is 0

Oct 18 19:44:27 DEBUG NSLog  -  === Begin Internal Transaction
Oct 18 19:44:27 DEBUG NSLog  -  evaluateExpression: 
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.id FROM 
Transaction t0 WHERE t0.transactionTypeID = ?::int4 LIMIT 57584 OFFSET 0" 
withBindings: 1:1(transactionTypeID)>
Oct 18 19:44:27 DEBUG NSLog  - 57584 row(s) processed
Oct 18 19:44:27 DEBUG NSLog  -  === Commit Internal Transaction
Oct 18 19:44:28 DEBUG NSLog  -  === Begin Internal Transaction

the remainder of my bindings is not being passed so It tries to grab 57584 rows 
and then the relationships for those 57584 (that is where the sql sentence gets 
nasty long)

When I specify a batchsize of 20

Oct 18 19:51:27 DEBUG NSLog  -  === Begin Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  evaluateExpression: 
<com.webobjects.jdbcadaptor.PostgresqlExpression: "select count(*)  FROM 
Transaction t0 WHERE (t0.dateEnd > ?::timestamp AND (t0.dateEnd < ?::timestamp 
AND t0.transactionTypeID = ?::int4))" withBindings: 1:2012-10-01 
00:00:00.0(dateEnd), 2:2012-10-31 00:00:00.0(dateEnd), 3:1(transactionTypeID)>
Oct 18 19:51:27 DEBUG NSLog  - 1 row(s) processed
Oct 18 19:51:27 DEBUG NSLog  -  === Commit Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  === Begin Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  evaluateExpression: 
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.id FROM 
Transaction t0 WHERE (t0.dateEnd > ?::timestamp AND (t0.dateEnd < ?::timestamp 
AND t0.transactionTypeID = ?::int4)) LIMIT 20 OFFSET 0" withBindings: 
1:2012-10-01 00:00:00.0(dateEnd), 2:2012-10-31 00:00:00.0(dateEnd), 
3:1(transactionTypeID)>
Oct 18 19:51:27 DEBUG NSLog  - 20 row(s) processed
Oct 18 19:51:27 DEBUG NSLog  -  === Commit Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  === Begin Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  evaluateExpression: 
<com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT 
t0.assemblyTransaction_id, t0.averageCost, t0.billNumber, t0.contact_id, 
t0.cost, t0.dateEnd, t0.dateStart, t0.id, t0.location_id, t0.locked, t0.note, 
t0.part_id, (t0.id), t0.project_id, t0.purchaseOrder, t0.quantity, 
t0.receptionNumber, t0.reversedTransaction_id, t0.runningTotalCost, 
t0.runningTotalQty, t0.transactionTypeID FROM Transaction t0 WHERE (t0.id = 
?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = 
?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = 
?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = 
?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = 
?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4 OR t0.id = ?::int4)" 
withBindings: 1:144034(id), 2:144068(id), 3:144060(id), 4:144075(id), 
5:144084(id), 6:144149(id), 7:144151(id), 8:144156(id), 9:144155(id), 
10:144153(id), 11:144154(id), 12:144152(id), 13:144185(id), 14:144186(id), 
15:144180(id), 16:144182(id), 17:144188(id), 18:144184(id), 19:144187(id), 
20:144181(id)>
Oct 18 19:51:27 DEBUG NSLog  - 20 row(s) processed
Oct 18 19:51:27 DEBUG NSLog  -  === Commit Internal Transaction
Oct 18 19:51:27 DEBUG NSLog  -  === Begin Internal Transaction
.....

A difference seems to be the "select count(*)... " where it tries to find how 
many row there are and it uses the passed bindings.

So I now have to figure out 
1) why the bindings don't follow and
2) why the absence of the select count(*)  statement...



Cheers


On 2012-10-18, at 19:24 , Louis Demers <[email protected]> wrote:

> I think there is so much logging that I probably missed the beginning of the 
> original sql debug messages which may have pointed to a clue why it wants to 
> fetch so many relationships when only one row should be fetched...
> It's as if it does not figure out properly the proper number of rows that 
> match the criteria when the batchsize is 0 (but I have yet to find a way to 
> get such evidence)
> 
> 
> 
> On 2012-10-18, at 18:45 , Chuck Hill <[email protected]> wrote:
> 
>> 
>> 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 protected]> 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 protected])
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>>>> 
>>>>> This email sent to [email protected]
>>>> 
>>>> -- 
>>>> 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 protected])
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>> 
>>> This email sent to [email protected]
>> 
>> -- 
>> 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.
> www.obzerv.com
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/louisdemers%40mac.com
> 
> This email sent to [email protected]

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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to