Testing migration from SmartClient_v90p_2013-12-07_PowerEdition to SmartClient_v91p_2014-03-04_PowerEdition
I am observing some strange behavior. We have two separate web applications both using SmartClient power edition deployed to same tomcat server. The two apps have a lot of common boilerplate code. So they have many datasource ds.xml files that have same names. Please note that the ds.xml files have same names but are two separate files residing in their respective web applications. And in some cases the ds.xml contents differ due to differing app requirements.
For example users.ds.xml in webapp1 has below fetch method :
and the users.ds.xml file in webapp2 has below fetch method :
Both these web applications were working fine together in tomcat with SmartClient_v90p_2013-12-07_PowerEdition but after upgrading on test machine to SmartClient_v91p_2014-03-04_PowerEditionNow, and while using webapp2 I am observing intermittent errors in log like :
=== 2014-03-24 15:43:27,919 [c-22] WARN RequestContext - dsRequest.execute() failed:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "$"
The query that caused this error is :
But webapp2 does not use this query. It uses a different query as shown above based on $criteria.
Another instance of this problem is even stranger.
In webapp2 I have a musersettings.ds.xml file without a fetch method declared. i.e. it uses the default fetch. In webapp1 musersettings.ds.xml, I have a fetch method with a customsql AND a operationId=fetchSuperAdminRole. In some places in webapp1 we load data from musersettings datasource via : isc.DataSource.get('musersettings').fetchData(null, some_callback_fn,{operationId:"fetchSuperAdminRole"});
I have observed that intermittently, while loading webapp1 the default fetch of webapp2 is performed not the customsql fetch of operationid=fetchSuperAdminRole of webapp1. This does not cause an error but screws the application logic.
I said intermittent because sometimes, after restarting tomcat, both webapps work properly each getting its intended query, but on some restart or webapp reloading because of a commit, this error starts appearing again.
My questions are :
1) Why is webapp1 query being run for webap2? ( and the opposite sometimes)
2) Is it because the datasource names are same?
3) If yes why did this not ever bother us in SmartClient_v90p_2013-12-07_PowerEdition?
I am observing some strange behavior. We have two separate web applications both using SmartClient power edition deployed to same tomcat server. The two apps have a lot of common boilerplate code. So they have many datasource ds.xml files that have same names. Please note that the ds.xml files have same names but are two separate files residing in their respective web applications. And in some cases the ds.xml contents differ due to differing app requirements.
For example users.ds.xml in webapp1 has below fetch method :
Code:
<operationBinding operationType="fetch"> <tableClause>muser,mclient,mparty,mpartybranch</tableClause> <whereClause>muser.usercode = $session.usercode AND muser.clientid = $session.clientid </whereClause> </operationBinding>
Code:
<operationBinding operationType="fetch"> <tableClause>muser,mclient,mparty,mpartybranch</tableClause> <whereClause>muser.usercode = $criteria.usercode AND muser.clientid = $criteria.clientid </whereClause> </operationBinding>
=== 2014-03-24 15:43:27,919 [c-22] WARN RequestContext - dsRequest.execute() failed:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "$"
The query that caused this error is :
Code:
=== 2014-03-24 15:43:27,918 [c-22] INFO SQLDriver - [builtinApplication.users_fetch] Executing SQL query on 'USCProduction-localhost': SELECT muser.userid, muser.username, muser.userloginname, muser.clientid, mclient.clientname, muser.workpartybranchid, mpartybranch.partybranchcode, mpartybranch.partybranchshortname, mpartybranch.partyid, mparty.partyname, muser.password, muser.salt FROM muser,mclient,mparty,mpartybranch WHERE muser.usercode = $session.usercode AND muser.clientid = '414474781000924' AND muser.userid = muser.userid AND muser.clientid = mclient.clientid AND muser.workpartybranchid = mpartybranch.partybranchid AND mpartybranch.partyid = mparty.partyid
Another instance of this problem is even stranger.
In webapp2 I have a musersettings.ds.xml file without a fetch method declared. i.e. it uses the default fetch. In webapp1 musersettings.ds.xml, I have a fetch method with a customsql AND a operationId=fetchSuperAdminRole. In some places in webapp1 we load data from musersettings datasource via : isc.DataSource.get('musersettings').fetchData(null, some_callback_fn,{operationId:"fetchSuperAdminRole"});
I have observed that intermittently, while loading webapp1 the default fetch of webapp2 is performed not the customsql fetch of operationid=fetchSuperAdminRole of webapp1. This does not cause an error but screws the application logic.
I said intermittent because sometimes, after restarting tomcat, both webapps work properly each getting its intended query, but on some restart or webapp reloading because of a commit, this error starts appearing again.
My questions are :
1) Why is webapp1 query being run for webap2? ( and the opposite sometimes)
2) Is it because the datasource names are same?
3) If yes why did this not ever bother us in SmartClient_v90p_2013-12-07_PowerEdition?
Comment