• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Client Responsibilities?

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Spec 21.5 defines the following rule:

if transactional requests within a single transaction arrive from multiple clients (this could happen if there are intermediary objects or programs in the transaction call chain), all requests within the same transaction must be associated with the same security context



My question here is how can requests from multiple clients occur within the same transaction? A transaction is owned by a client. How can other clients get inside my transaction?

If the bean calls two methods (A and B) one after the other and the bean is being accessed by multiple clients, each client will call both methods. Are we saying that if client 1 calls method A, client 2 may then call method B and if the method attribute of B is Required, that method B occurs within the same transaction as method A?

Also, I am assuming that the bean can only be an entity bean, since this is the only been that allows concurrent access by multiple clients.

Is this understanding correct?
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There was actually a great discussion on this about a month or so ago. The term somebody came up with was that of a "pink" bean. A pink bean is one that was involved in attempting to be invoked by a client, but is already involved in an open transaction by the same client. Think in terms of trans-attribs like "RequiresNew", etc.

You can search the past forum posts to find it.
 
Simon Ingram
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nathaniel,

I searched for "pink bean" couldn't find anything. Any idea on what to search for?
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/159374/java-EJB-SCBCD/certification/clarification-transaction

Also, here is a topic on nested transactions:
https://coderanch.com/t/314143/EJB-JEE/java/EJB-Transaction-Rollback-JBDC
[ June 07, 2004: Message edited by: Roger Chung-Wee ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic