Strange behaviour after IDfQuery.execute
Hi everyone,
I'm experiencing sometimes a really strange behaviour after executing a dql thanks to IDfQuery.execute : the collection returned does not contain anything even if the query has to always return something (for example a "count" query). Have you ever experimented such a behaviour ?
Here is my code (hard to make it simplier) :
String dql = "SELECT COUNT(*) AS cpt FROM dm_dbo.myview WHERE project_id = 132861";IDfQuery dfQuery = new DfQuery(dql);IDfCollection coll = null;try { coll = dfQuery.execute(dfTypedObject.getObjectSession(), IDfQuery.DF_READ_QUERY); if (coll.next()) { result = coll.getString("cpt"); } else { throw new DfException("Scalar Query has not return any result : " + dql); }} finally { if (coll != null) { coll.close(); }}
It's the first time i'm trying to work with threads, I know of the limitation of 10 collections per session but i'm using a different session for each thread so i don't think that's that ... Is there something else i should know ?
I'm using DFC 6.7sp1.
Comments
-
Try:
result = coll.getTypedObject().getString("cpt");
0 -
Looks like you are reading values from "myview" which is external to the repository. Create a similar code but only using JDBC and NO dfc; check if you are encountering the issue.
If not, try using DF_EXECREAD_QUERY
-karthik
0 -
Karthik Chokkaraman a écrit:Looks like you are reading values from "myview" which is external to the repository. Create a similar code but only using JDBC and NO dfc; check if you are encountering the issue.If not, try using DF_EXECREAD_QUERY-karthik
Hi,
"dm_dbo.myview" is an example, sometimes it's a standard dql query which fails.
N/A [Update ACL 3] com.documentum.fc.client.DfQuery@c6af24.<init>("SELECT DISTINCT object_name FROM dm_docbase_config") ==> <void>
<dmadmin|s30(30.547)|SM@33175995> [Update ACL 3] com.documentum.fc.client.DfQuery@c6af24.execute(com.documentum.fc.client.impl.session.StrongSessionHandle@1769f17,0) ==> com.documentum.fc.client.IDfCollection@18ebb11
<dmadmin|s30(30.547)|SM@33175995> [Update ACL 3] com.documentum.fc.client.impl.collection.CollectionHandle@18ebb11.next() ==> falseAs you can see, i'm using the installation owner to launch my script so there is no way this query won't return any result ...
I tried with DF_EXECREAD_QUERY also and no luck.
The only way, i was able to execute my script is to not use threads. I must do something wrong but can't figure that out.
0 -
Johnny Gee a écrit:Have you verified that the query returns something in Documentum Administrator?
Yep, the query returns results ...
0 -
Francois Dauberlieu a écrit:Try:result = coll.getTypedObject().getString("cpt");
It's not the value which is returned, it's the call to "next" method which returns false.
0 -
bacham2 a écrit:Perhaps the session you are using (
dfTypedObject.getObjectSession())
has already been released. Or perhaps it is released only in certain circumstances. In any case, something must be wrong in your session handling.In fact, i'm lauching the query from a method from a custom SBO which takes an IDfSysObject as a parameter and the query is generated dynamicaly thanks to some attributes recovered from that IDfSysObject (the IdfTypedObject), so i don't think that the session is closed. But to be sure, since yesterday, i tried not to recover the session from the IDfSysObject but from the method IDfService.getSession() and there is no difference.
0 -
Using IDfService.getSession is definitely the way to go. There still must be a session handling issue in your code though. Can you post your code that instantiates the SBO and instantiates the sessions?
You mentioned threads in the beginning: does your code always work when you only have a single thread?
0 -
Here is my 2 cents,
You said you get the result using the DQL from DA, right?
What user credentials you use to login to DA? System Administrator?
And also let us know you query code is executed with which user? (what permissions that user has).
Also post your code here
0 -
@Jeremy_LU did you manage to solve it? I'm facing similar issue with DFC 7.3 and also 16.4 where the DQL is executed in a Job under JMS, where the job creates another threads and the DQL is executed from those threads.
It happens only sometimes and only under JMS, outside JMS it is not possible to simulate that situation.
0 -
@cgrim_cz said:
@Jeremy_LU did you manage to solve it? I'm facing similar issue with DFC 7.3 and also 16.4 where the DQL is executed in a Job under JMS, where the job creates another threads and the DQL is executed from those threads.It happens only sometimes and only under JMS, outside JMS it is not possible to simulate that situation.
Sorry, I never found what was causing the problem and finally I didn't use threads
0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 105 General Questions
- 142 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management