[Persistence, JBoss/CMP, Hibernate, Database] - Re: How to do a Max in a sub query...
by arnieOag
This compiles and runs but doesn't get rid of the first record.
| from us.tx.state.oag.olrap.db.InfoApplication as apps
| where
| apps.codeStatus.statusId = :codeStatus
| and apps.infoWorkflows.emplid = :emplId
| and apps.infoWorkflows.entryDate = ( select max(wf.entryDate)
| from apps.infoWorkflows wf
| where wf.infoApplication.applicationId = apps.applicationId
| )
| order by apps.createdDate asc
|
The SQL generated is a little off...
| 13:13:04,031 INFO [STDOUT] Hibernate: select infoapplic0_.application_id as applicat1_494_, infoapplic0_.fiscal_year_id as fiscal2_494_, infoapplic0_.evaluation_id as evaluation3_494_, infoapplic0_.status_id as status4_494_, infoapplic0_.base_award as base5_494_, infoapplic0_.closed_date as closed6_494_, infoapplic0_.created_date as created7_494_, infoapplic0_.emplid as emplid494_, infoapplic0_.hire_date as hire9_494_, infoapplic0_.job_code as job10_494_, infoapplic0_.last_eval_date as last11_494_, infoapplic0_.months_of_service as months12_494_, infoapplic0_.ok_with_bar as ok13_494_, infoapplic0_.submitted_date as submitted14_494_, infoapplic0_.calculated_award as calculated15_494_, infoapplic0_.actual_award as actual16_494_, infoapplic0_.award_date as award17_494_, infoapplic0_.cr_who as cr18_494_, infoapplic0_.cr_when as cr19_494_, infoapplic0_.up_who as up20_494_, infoapplic0_.up_when as up21_494_ from info_application infoapplic0_, info_workflow infoworkfl1_, info_workflow infoworkfl2_ where infoapplic0_.application_id=infoworkfl2_.application_id and infoapplic0_.application_id=infoworkfl1_.application_id and infoapplic0_.status_id=? and infoworkfl1_.emplid=? and infoworkfl2_.entry_date=(select max(infoworkfl3_.entry_date) from info_workflow infoworkfl3_ where infoapplic0_.application_id=infoworkfl3_.application_id and infoworkfl3_.application_id=infoapplic0_.application_id) order by infoapplic0_.created_date asc
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118813#4118813
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118813
18 years, 3 months
[JBoss Seam] - Re: Strange behaviour of Seam Mail when sending unsynchonize
by MSchmidke
Yes, but to explain it I must go a little deeper.
My template looks like
| <ui:repeat value="#{recipients}" var="rec">
| <m:to>#{rec}</m:to>
| ....
| </ui:repeat>
|
and recipients gets into the context by
| @Asynchronous
| public void send(List<String> recipients) {
| Context c=Contexts.getEventContext();
| c.set("recipients", recipients);
| renderer.render("...");
| }
|
The caller is a jBPM action class with:
| Mailhandler mh=(Mailhandler)Components.getInstance(Mailhandler.class);
| mh.send(new Vector<String>(getRecipients()));
|
If I only send one mail, everything works fine. If I send two at the same time (two mail actions in jBPM which are executed immediately one after the other), I get some error from class InternetAddress telling the recipient's syntax is wrong ("@domain" is missing). I think either the ui:repeat or the m:to gets confused in some way when simultaneously used in multiple threads.
I checked everything, I can't find any other synchronizity side effect (for example in the recipients list - everything is copied before usage), so I think it must be some issue with the renderer.
(I wrote this all from memory; if you need even more info, let me know, I'll post the exact strack trace when I'm back in office tomorrow)
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118810#4118810
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118810
18 years, 3 months