• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Sharing of Resource

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its given in the core specs(pg 425),that,


The value of the res-sharing-scope element
is Shareable or Unshareable. If the res-sharing-scope element is not specified, connections
are assumed to be shareable.
A resource manager connection factory reference is scoped to the enterprise bean whose declaration
contains the resource-ref element.



If the resource manager is scoped to the bean in which it is declared, then how can it be shared?
 
nitin pai
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any ideas?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A resource manager connection factory reference may be scoped to a component but multiple components can reference the same connection factory - i.e. you define a single datasource in your app server then reference it from multiple components.

When a connection is marked as sharable it can be reused by multiple components executing in the same transaction. For example EJB1 starts a transaction, obtains a JDBC connection, uses it, and then invokes a method on EJB2. EJB2 also uses a JBDC connection with same connection properties as the one used EJB1. If the connection is shareable EJB2 will reuse the same connection, as opposed to creating a new one.

Check out the JCA spec if this still isn't clear.
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic