[JBoss jBPM] - Re: ProcessDefinition in 2nd level cache
by a.grin
Hi Roland,
Read-only data doesn't mean read-only Session instance. Session caches all read data internally (1st level cache), so each select may change its state. I'm not sure if it applies for the objects that are cached also in the 2nd level cache but in any case I would follow the recommendation in the Hibernate documentation not to use one session from several threads because there is no guarantee that if this concurrent access works now without problems (and I don't expect it does) it will be also working with the future versions.
Besides, usually you do not access process definition directly. You start from process instance. In my case even from another object that contains process instance. And process definition (there can be of course many of them) will be transparently loaded from the session that loaded my main object. And it is also kind of problematic to keep all these sessions open. Having used Hibernate intensively in the last 3 years I believe that the objects with lazy loading in the 2nd level cache is a problem. At least I have no idea how to deal with it. Maybe someone from jbpm development can explain what usage scenario they had in mind.
Thanks. Andrey.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041074#4041074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041074
17 years, 8 months
[JBoss Seam] - Do I need to use FlushMode.MANUAL for this??
by lindsayh
Hello,
I have a form where a user can modify their details, including their username. So, when user saves form, I want to check that the username is unique in the database. Here's the code I use to do this (where casUser is the entity that's backing my form):
| Query usernameQuery = casDatabase
| .createQuery("select c from CasUser c where upper(username) = upper(:username)");
| usernameQuery.setParameter("username", casUser.getUsername());
| List<CasUser> usernameResults = usernameQuery.getResultList();
| if (usernameResults.size() > 0 && !usernameResults.get(0).equals(casUser))
| {
| facesMessages.addToControl("username",
| "Another user exists with this username");
| return false;
| }
| return true;
|
Unfortunately, just before the query is executed, the entity I'm checking is automatically updated in the database, causing a UniqueConstraintViolation. This is precisely what i want to avoid by doing the check!
I can get around this by setting the conversation's flushMode to MANUAL. But I don't really like to do this. I like to stick with the defaults for as long as I possibly can!
Is this the only way to stop it updating the database before I've done my validation checks??
Many thanks.
Lindsay
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041073#4041073
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041073
17 years, 8 months
[JBoss jBPM] - Re: jbpm3.2 on jboss 4.0.5
by rishikumarsharma
Any idea !!!!
| Caused by: java.sql.SQLException: Column not found: THIS_.VERSION_ in statement [select top ? this_.ID_ as ID1_27_3_, this_.VERSION_ as VERSION3_27_3_, this_.NAME_ as NAME4_27_3_, this_.DESCRIPTION_ as DESCRIPT5_27_3_, this_.ACTORID_ as ACTORID6_27_3_, this_.CREATE_ as CREATE7_27_3_, this_.START_ as START8_27_3_, this_.END_ as END9_27_3_, this_.DUEDATE_ as DUEDATE10_27_3_, this_.PRIORITY_ as PRIORITY11_27_3_, this_.ISCANCELLED_ as ISCANCE12_27_3_, this_.ISSUSPENDED_ as ISSUSPE13_27_3_, this_.ISOPEN_ as ISOPEN14_27_3_, this_.ISSIGNALLING_ as ISSIGNA15_27_3_, this_.ISBLOCKING_ as ISBLOCKING16_27_3_, this_.TASK_ as TASK17_27_3_, this_.TOKEN_ as TOKEN18_27_3_, this_.PROCINST_ as PROCINST19_27_3_, this_.SWIMLANINSTANCE_ as SWIMLAN20_27_3_, this_.TASKMGMTINSTANCE_ as TASKMGM21_27_3_, token1_.ID_ as ID1_21_0_, token1_.VERSION_ as VERSION2_21_0_, token1_.NAME_ as NAME3_21_0_, token1_.START_ as START4_21_0_, token1_.END_ as END5_21_0_, token1_.NODEENTER_ as NODEENTER6_21_0_, token1_.NEXTLOGINDEX_ as NEXTLOGI7_21_0_, token1_.ISABLETOREACTIVATEPARENT_ as ISABLETO8_21_0_, token1_.ISTERMINATIONIMPLICIT_ as ISTERMIN9_21_0_, token1_.ISSUSPENDED_ as ISSUSPE10_21_0_, token1_.LOCK_ as LOCK11_21_0_, token1_.NODE_ as NODE12_21_0_, token1_.PROCESSINSTANCE_ as PROCESS13_21_0_, token1_.PARENT_ as PARENT14_21_0_, token1_.SUBPROCESSINSTANCE_ as SUBPROC15_21_0_, processins2_.ID_ as ID1_20_1_, processins2_.VERSION_ as VERSION2_20_1_, processins2_.KEY_ as KEY3_20_1_, processins2_.START_ as START4_20_1_, processins2_.END_ as END5_20_1_, processins2_.ISSUSPENDED_ as ISSUSPEN6_20_1_, processins2_.PROCESSDEFINITION_ as PROCESSD7_20_1_, processins2_.ROOTTOKEN_ as ROOTTOKEN8_20_1_, processins2_.SUPERPROCESSTOKEN_ as SUPERPRO9_20_1_, processdef3_.ID_ as ID1_4_2_, processdef3_.NAME_ as NAME3_4_2_, processdef3_.DESCRIPTION_ as DESCRIPT4_4_2_, processdef3_.VERSION_ as VERSION5_4_2_, processdef3_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_4_2_, processdef3_.STARTSTATE_ as STARTSTATE7_4_2_ from JBPM_TASKINSTANCE this_ inner join JBPM_TOKEN token1_ on this_.TOKEN_=token1_.ID_ inner join JBPM_PROCESSINSTANCE processins2_ on token1_.PROCESSINSTANCE_=processins2_.ID_ inner join JBPM_PROCESSDEFINITION processdef3_ on processins2_.PROCESSDEFINITION_=processdef3_.ID_ where this_.ACTORID_=? and this_.ISOPEN_=?]
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041066#4041066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041066
17 years, 8 months
[JBoss Seam] - Re: issue with itext pdf generation and JSF RI
by borisrodman
Hi
I managed to find the issue:
in the UIdocument class seam forward to a page that redirect to the PDF document:
the page rendered has no Doctype specified and the MIME return type is set to XML/Application (or something similar) therefore firefox doesn't know what to do with it.
A agree with you that it doesn't bother IE
to fix the issue you must change the class:
(jboss-seam-1.2.1.GA\src\pdf)
org.jboss.seam.pdf.ui.UIDocument to output a doctype:
in the medhod: public void encodeBegin(FacesContext context)
replace the following lines (from line 233):
| ResponseWriter response = context.getResponseWriter();
| response.startElement("html", this);
| response.startElement("head", this);
by
| ResponseWriter response = context.getResponseWriter();
| response.write("<!DOCTYPE composition PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >");
| response.startElement("html", this);
| response.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml", null);
| response.startElement("head", this);
then recompile seam using the std build file (this will also recompile jboss-seam-pdf.jar where this class ends-up)
and replace jboss-seam-pdf.jar in your project by the re-compiled jar
It SHOULD work ! (At leasts it does for me)
Also note that if you use the source code from CVS the jboss.jpg image in the itext example was corrupted last week which resulted in the PDF rendering to fail. (I don't know if this has been corrected since then)
Let me know if you have any issues !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041060#4041060
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041060
17 years, 8 months