Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

res-sharing-scope in resouce-ref tag

 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any body know what it exactly means to have <res-sharing-scope> as Shareable? Does it mean it is shareable across the J2EE application and other beans in the application can access the resouce without defining?
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suman do you have answer for the above question?
 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per spec:

The Bean Provider can control the shareability of the connections acquired from the resource manager connection factory. By default, connections to a resource manager are shareable across other enterprise beans in the application that use the same resource in the same transaction context. The Bean Provider can specify that connections obtained from a resource manager connection factory reference are not shareable by specifying the value of the "res-sharing-scope" deployment descriptor element to be "Unshareable". The sharing the connections to a resource manager allows the container to optimize the use of connections and enables the container's use of local transactions optimizations.

It means that other beans in the same app, using the same resource, in the same transaction can use the same connection.
 
Sujatha Kumar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody brief me,

What is the objective of specifying the res-sharing-scope as "UnShareable",
does this option really help?

your responses are highly appreciated.

Regards
 
Suman Sarker
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mini,
Does any body know what it exactly means to have <res-sharing-scope> as Shareable?

If a bean sepcifies the res-sharing-scope element as "Shareable", this means that the bean is allowing other beans in the same application to use the connection it obtained through the resource manager connection factory. This does not mean that the other enterprise beans in the same application can have access to the shared connection anytime they want. They can access the shared connection only when they are using the same resource in the same transaction context.
Does it mean it is shareable across the J2EE application and other beans in the application can access the resouce without defining?

Yes, it does mean the connection is shareable accross the application but other beans in that application cannot access the shared connection without defining the resource-ref element.

Suman do you have answer for the above question?

Sorry for the delayed response. I was busy for last copule of days. Anyway, let me know if I have explained it right.

Regards
Suman
[ June 19, 2004: Message edited by: Suman Sarker ]
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Suman. Great answer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic