From: Mike S. <ms...@md...> - 2007-05-18 03:13:22
|
Locking OSC still wouldn't fix this for multiple OSC's ... The implementation of this is really sketchy. It seems to me to be just asking for weird problems like you're seeing. I think the underlying implementation needs to be revisited to not mess with the actual model objects to execute the query. ms On May 17, 2007, at 5:57 PM, Chuck Hill wrote: > > On May 17, 2007, at 2:48 PM, Kieran Kelleher wrote: > >> That very well could be the case since the fetch error is happening >> in a long response and just maybe another user in the app is >> looking at a web page that is using the count in a different >> OSC ...... looking at that source in Wonder there is a synchronized >> block surrounding it ... >> synchronized (entity) { >> entity.addAttribute(attribute); >> try { >> fs.setFetchesRawRows(true); >> fs.setRawRowKeyPaths(new NSArray(attribute.name())); >> results = ec.objectsWithFetchSpecification(fs); >> } finally { >> entity.removeAttribute(attribute); >> } >> } >> } >> >> What do you suggest ..... lift out that code and lock the ec's OSC >> to get the count? > > The way I read that code, it prevents two threads from entering that > block for the same entity at the same time. It does not prevent > access to the entity in any other code. I would not change the > Wonder code, just > > osc.lock(); > try { > // do the count and whatever else is needed, but don't waste time > in here, OSC locking blocks everything else! > } finally { > osc.unlock(); > } > > > Chuck > > >> >> On May 17, 2007, at 5:29 PM, Chuck Hill wrote: >> >>> Just a wild guess, but looking at that code, it is not doing any >>> locking. I would think you would want the OSC locked while >>> muddling with the model. I'd guess that one thread is doing a >>> count, while another is doing a regular fetch. >>> >>> Chuck >>> >>> >>> On May 17, 2007, at 2:03 PM, Kieran Kelleher wrote: >>> >>>> Hello wonder list, >>>> >>>> I have this unusual bug that occasionally throws error shown >>>> below and it is hard to reproduce. A "count(*)" attribute is >>>> being inserted in the SQL fetch statement. I am guessing that the >>>> count(*) attribute is added to the entity in Wonder's count >>>> utility when I call this.... >>>> >>>> ERXEOControlUtilities.objectCountWithQualifier( editingContext(), >>>> CTMessage.ENTITY_NAME, messagesQualifier() ); >>>> >>>> ......and somehow it is not getting removed ..... but that does >>>> not make sense because the Wonder method .... >>>> >>>> ERXEOControlUtilities._objectCountWithQualifierAndAttribute >>>> (ec,entityName,qualifier,attribute); >>>> >>>> .... clearly shows the attribute being removed in a try/finally >>>> block. >>>> >>>> Could it be something to do with INHERITANCE (single table) of >>>> CTMessage. CTMessage is abstract and currently only one subclass >>>> exists CTSmartMixMessage?? >>>> >>>> Here is the ERROR and I have bold underlined the stray count(*) >>>> attribute that has sneaked into the entity ..... >>>> >>>> Any help is appreciated .... >>>> >>>> 4412461 ERROR 2007-05-17 16:10:23,206 >>>> [wk.cheetah.JobGenerateDownloadFileLRTask@80723e] >>>> >>>> (er.extensions.ERXLongResponseTask$DefaultImplementation, run, >>>> ERXLongResponseTask.java:166) - >>>> >>>> long response thread raised : EvaluateExpression failed: >>>> <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT >>>> DISTINCT t0.inheritancetype, t0.messagecode, t0.oid, >>>> t0.oidcampaign, t0.oiddatarecord, t0.oidjob, t0.oidlocation, >>>> t0.oidmediatemplate, count(*), t0.recaddtime, t0.recadduser, >>>> t0.recmodtime, t0.recmoduser, RTRIM(t0.workflowstate) FROM >>>> message t0 WHERE (t0.inheritancetype = ? AND t0.oidjob = ?)" >>>> withBindings: 1:10(inheritanceType), 2:82(oidJob)>: >>>> Next exception:SQL State:42000 -- error code: 1140 -- msg: >>>> Syntax error or access violation message from server: "Mixing of >>>> GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is >>>> illegal if there is no GROUP BY clause" >>>> com.webobjects.jdbcadaptor.JDBCAdaptorException: >>>> EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPlugIn >>>> $MySQLExpression: "SELECT DISTINCT t0.inheritancetype, >>>> t0.messagecode, t0.oid, t0.oidcampaign, t0.oiddatarecord, >>>> t0.oidjob, t0.oidlocation, t0.oidmediatemplate, count(*), >>>> t0.recaddtime, t0.recadduser, t0.recmodtime, t0.recmoduser, RTRIM >>>> (t0.workflowstate) FROM message t0 WHERE (t0.inheritancetype = ? >>>> AND t0.oidjob = ?)" withBindings: 1:10(inheritanceType), 2:82 >>>> (oidJob)>: >>>> Next exception:SQL State:42000 -- error code: 1140 -- msg: >>>> Syntax error or access violation message from server: "Mixing of >>>> GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is >>>> illegal if there is no GROUP BY clause" >>>> at com.webobjects.jdbcadaptor.JDBCContext._jdbcErrorWithChannel >>>> (JDBCContext.java:138) >>>> at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression >>>> (JDBCChannel.java:310) >>>> at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression >>>> (JDBCChannel.java:261) >>>> at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes >>>> (JDBCChannel.java:185) >>>> at >>>> com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecifica >>>> t >>>> ionEditingContext(EODatabaseChannel.java:878) >>>> at >>>> com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpe >>>> c >>>> ification(EODatabaseChannel.java:215) >>>> at >>>> com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecific >>>> a >>>> tionEditingContext(EODatabaseContext.java:3205) >>>> at >>>> com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecifica >>>> t >>>> ion(EODatabaseContext.java:3346) >>>> at >>>> com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchS >>>> p >>>> ecification(EOObjectStoreCoordinator.java:539) >>>> at >>>> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecifica >>>> t >>>> ion(EOEditingContext.java:4114) >>>> at er.extensions.ERXEC.objectsWithFetchSpecification(ERXEC.java: >>>> 1075) >>>> at >>>> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecifica >>>> t >>>> ion(EOEditingContext.java:4500) >>>> at wk.cheetah.eof.CTJob.messages(CTJob.java:217) >>>> at wk.cheetah.eof.CTJob.fileToBeDownloaded(CTJob.java:181) >>>> at wk.cheetah.JobGenerateDownloadFileLRTask.performAction >>>> (JobGenerateDownloadFileLRTask.java:41) >>>> at er.extensions.ERXLongResponseTask$DefaultImplementation.run >>>> (ERXLongResponseTask.java:163) >>>> at java.lang.Thread.run(Thread.java:613) >>>> at er.extensions.ERXLongResponseTask$WorkerThread.run >>>> (ERXLongResponseTask.java:60) >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------- >>>> - >>>> ----- >>>> This SF.net email is sponsored by DB2 Express >>>> Download DB2 Express C - the FREE version of DB2 express and take >>>> control of your XML. No limits. Just data. Click to get it now. >>>> http://sourceforge.net/powerbar/db2/ >>>> _______________________________________________ >>>> Wonder-disc mailing list >>>> Won...@li... >>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >>> >>> -- >>> >>> 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/products/practical_webobjects >>> >>> >>> >>> >>> >> >> > > -- > > 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/products/practical_webobjects > > > > > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |