[JBoss Messaging] - Distributed Transaction using JMS, EJB and MDB
by jessiezam
Hi, good day to all.
First of all I would like to thank JBoss for having an excellent product. We've been using it for a mission critical system since 2005 handling more than 100T transactions a day and we encountered very few problems about it and its performance.
Recently, we are currently developing a distributed transactional solution with JBoss.4.0.5.GA using EJB3, JMS and MDB for our new client. Honestly, I have no experience using JMS and been studying it through the various sources and tutorials from the net. Based on what I understand ( and I might be wrong ;-) ), combining EJB3, JMS and MDB with distributed support under JBoss, it guarantees the 2PC requirement. Our problem and current test setup is described below:
1. A client app calls a PaymentServiceSessionBean to post payment on Server1.
2. The PaymentServiceSessionBean post a topic to PaymentTopic on Server1.
3. A PaymentMDB in server1 receives the topic and post the payment on the local db
4. A PaymentMDB in server2 (remote) receives the topic and post the payment on its localdb.
5. This will complete the transaction.
However, performing distributed transaction testing I ran into problems. When the posting of payment in server1 to the database fails, the server2 posting is not rolledback. The same when a failure in db transaction in server2, the update in server1 db is committed and not rolledback.
Theorethically I believe this common scenario is supported by JBoss and J2EE inparticular. I hope for your expert advise and technical expertise.
Thanks in advance.[/img]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163816#4163816
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163816
17 years, 10 months
[JBoss jBPM] - Re: does this design make sense?
by dOoMi
"kukeltje" wrote : anonymous wrote : jBPM swallows the StaleObjectStateException causing the calling code not to notice that the operation failed. Afaik, that can be configured in jBPM 3.2.3. Please have a look in the docs
|
i'm afraid not. i've been on this thing several hours. the configuration allows you to influence the logging but not the handling of StaleObjectStateExceptions. you can see that clearly when having a look at the source of the Services class:
public void close() {
| 236: if (services != null) {
| 237: Map closeExceptions = new HashMap();
| 238: Throwable firstException = null;
| 239: Iterator iter = serviceNames.iterator();
| 240: while (iter.hasNext()) {
| 241: String serviceName = (String) iter.next();
| 242: Service service = (Service) services.get(serviceName);
| 243: if (service != null) {
| 244: try {
| 245: log.debug("closing service '" + serviceName
| 246: + "': " + service);
| 247: service.close();
| 248: } catch (JbpmPersistenceException e) {
| 249: // if this is a stale object exception, the jbpm configuration has control over the logging
| 250: if ("org.hibernate.StaleObjectStateException"
| 251: .equals(e.getCause().getClass()
| 252: .getName())) {
| 253: log.info("problem closing service '"
| 254: + serviceName
| 255: + "': optimistic locking failed");
| 256: StaleObjectLogConfigurer.staleObjectExceptionsLog
| 257: .error(
| 258: "problem closing service '"
| 259: + serviceName
| 260: + "': optimistic locking failed",
| 261: e);
| 262: } else {
| 263: log.error("problem closing service '"
| 264: + serviceName + "'", e);
| 265: }
| 266: } catch (Exception e) {
| 267: // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
| 268: log.error("problem closing service '"
| 269: + serviceName + "'", e);
| 270: closeExceptions.put(serviceName, e);
| 271: if (firstException == null) {
| 272: firstException = e;
| 273: }
| 274: }
| 275: }
| 276: }
| 277: if (!closeExceptions.isEmpty()) {
| 278: throw new JbpmException("problem closing services "
| 279: + closeExceptions, firstException);
| 280: }
| 281: }
| 282: }
| 283:
| 284: public static void assignId(Object object) {
| 285: JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
| 286: if (jbpmContext != null) {
| 287: // give this process instance an id
| 288: Services services = jbpmContext.getServices();
| 289: if (services.hasService(Services.SERVICENAME_PERSISTENCE)) {
| 290: PersistenceService persistenceService = services
| 291: .getPersistenceService();
| 292: persistenceService.assignId(object);
| 293: }
| 294: }
| 295: }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163811#4163811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163811
17 years, 10 months