• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Two transactions in one CMP MDB  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a CMP MDB, triggered by websphere scheduler and do some process. There is a requirement that I need to write a record in the error logging table when exception thrown from the process. But if there is exception, my transaction is rollback and so as the record in the error logging table. Is there any way I can begin another transaction in CMP?

I'm using websphere 6.1 and oracle 10g.

Thanks in advance.

Rick
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rickdias rickdias",
Welcome to JavaRanch!

We're pleased to have you here with us here on the ranch, but there are a few rules that need to be followed. One is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Initials are OK for the first and middle names but not the last. You can change it here
[ April 25, 2008: Message edited by: Ben Souther ]
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the NotSupported transaction attribute for the method which is doing the logging. This will ensure that the method will never take part in a transaction. If the logging method fails, then the calling process will not be affected because its transaction will have been suspended prior to calling the logging method.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As i understand the post, i would say "No, there's no way to start a new transaction in CMP", and suggest something like this..



By your post Roger it seems that you understood that first goes the logging, then the processing... maybe i've misunderstood it, Rick ?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The doLog() method would be a public method of a CMT stateless session bean. It will have the NotSupported transaction attribute. When an exception is caught in the MDB, the doLog() method is invoked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!