Tridion 2011 SP1 SDL code freezes when creating a Query Query object

The client is trying to integrate some broker request code into an existing web application. They have the following code:

public String doItNow(int keyA, String schemaA, String templateIdA) throws Exception { loggerInfo("doItNow.start" + ", key:" + keyA + ", schema:" + schemaA + ", templateId:" + templateIdA); StringBuffer sb = new StringBuffer(); PublicationCriteria pubCriteria = new PublicationCriteria(keyA); loggerInfo("doItNow.PC:" + pubCriteria); SchemaTitleCriteria schemaTitleCriteria = new SchemaTitleCriteria(schemaA); loggerInfo("doItNow.STC:" + schemaTitleCriteria); AndCriteria andCriteria = new AndCriteria(pubCriteria, schemaTitleCriteria); loggerInfo("doItNow.AC:" + andCriteria); Query query = new Query(); loggerInfo("doItNow.Query.0:" + query); query.setCriteria(andCriteria); loggerInfo("doItNow.Query.1:" + query); String[] results = query.executeQuery(); for (String r : results) { loggerInfo("doItNow.\tres:" + r); } ComponentPresentationAssembler cpa = new ComponentPresentationAssembler(keyA); loggerInfo("doItNow.CPA:" + cpa); for (String item : results) { loggerInfo(":>" + item); sb.append(cpa.getContent(item, templateIdA)); } return sb.toString(); } 

Code output when creating a Query object:

 Query query = new Query(); 

At this point, it freezes. Errors do not appear in the cd_core log file to suggest a reason for this. Can someone suggest areas where you can explore to debug this further or suggest a solution?

+4
source share
3 answers

There is a known issue with the JRE version 1.6.0.29 and the MSSQL jdbc driver. You need to either downgrade or upgrade to another version of JRE.

https://forums.oracle.com/forums/thread.jspa?threadID=2301826

The problem seems very similar to the problem being reported with the driver, and you also do not see error messages.

+7
source

Try changing the following line:

 query.setCriteria(andCriteria); 

in

 query.Criteria = andCriteria; 

In the SDL LiveContent example, there is a comment suggesting this change.

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/concept_0AB6D192D7AB4EC18892631F519EF1DD

0
source

Have you added the right options? (Tridion.ContentDelivery.DynamicContent.Query - namespace) Also, as Chris suggested, a query in tridion 2011 does not have a property like setCriteria . Use query.Criteria . Also have you made the necessary changes to cd_storage_conf.xml?

0
source

Source: https://habr.com/ru/post/1439136/


All Articles