[JBoss Seam] - OptimisticLockException
by lightbulb432
I have a versioned object for which I'd like an error message to show up when an OptimisticLockException occurs. Adding an entry to exceptions.xml doesn't do anything because, though the OLE is thrown as seen in the log, it's subsequently caught by something.
I'm not merging the object in an action method, however. The update to the object simply occurs as the result submitting a form with an inputText that is bound to a property on the versioned object.
When I submit the form bound with an out-of-date object, the exception is thrown but there's no output on the page to indicate so because the OLE doesn't reach out of the Seam layer to exceptions.xml.
How can I solve this? I'd think it'd be common enough that the JBoss forums would have some insight, but nothing is there on this issue!
I think I could have an action method and catch the exception there, but then I'd need the additional method, which would just do a merge(). And then I'm not taking advantage of the SMPC with its mergeless updates! (But this probably applies to EXTENDED PCs too...)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006098#4006098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006098
19 years, 2 months
[JBoss jBPM] - Re: Integration jBPM with JBoss AS 3.2.8
by alex.guizar@jboss.com
I actually reviewed JBoss 3.2.8 to see what is in there. I deleted the jboss-hibernate.sar dir and started the server. Nothing got broken up, so I assume you can remove it if your applications do not depend on Hibernate2. Once you do this, you can throw in find class version clashes if you throw in Hibernate3.
The story does not end there, tough. The jBPM console uses a web.xml descriptor that adheres to Servlet 2.4. JBoss 3.x supports Servlet 2.3 only. You'd have to migrate the descriptor and be ready for the challenge.
Further, it does not make sense to develop new applications against old standards. You should probably set up a separate JBoss 4.x instance and deploy your new applications there. The advantage of this option vs. jBPM standalone is that you can leverage the enterprise features such as the web container, managed data sources, JMS, etc.
Hope this helps,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006094#4006094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006094
19 years, 2 months
[JBoss Seam] - Re: How to really flush data in the middle of a transaction
by gavin.king@jboss.com
anonymous wrote : Don't set your MySQL transaction setting to READ UNCOMMITTED unless you really want to allow dirty reads (do you!?). I think you might've solved the wrong problem...setting READ UNCOMMITTED works because they're running in separate transactions like the previous post said.
Exactly. Dirty reads are VERY BAD. Read what I wrote about them in Hibernate in Action / Java Persistence with Hibernate.
anonymous wrote : Anybody have suggestions on how might you do this?
Most events are processed synchronously by Seam, so you would have to be doing something "funny" to get a different transaction context. Perhaps he has an asynchronous event. Or perhaps he has no transaction at all. Or perhaps the observer method has REQUIRES_NEW. No code, can't tell.
anonymous wrote : Can you just annotate observer methods with transaction attributes or is that only for session beans?
An observer method can be on a session bean. And even if it is not, you can annotate methods of JavaBean components with transaction attributes in Seam 1.1. But you should not need to do this. The default behavior is to propagate the transaction, for all component types.
By the way, another possibility in Seam 1.1.1 is to use an event that is processed after the transaction commit. This is an excellent way to handle refresh of session or application scoped state after the end of a conversation. The booking example uses this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006080#4006080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006080
19 years, 2 months