• Post Reply Bookmark Topic Watch Topic
  • New Topic

default attribute  RSS feed

 
eswar kumar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi can any one of u help me ....
What is the default Transaction Attribute in EJB?
advance thanX
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- there's isn't a default transaction attribute, although your particular deployment tool may have one that it puts in when it builds the deployment descriptor.
But if you're looking for a default attribute, then in the beginning I'd use "Required", unless you have a reason to use something else. It's usually the safest and most efficient.
cheers,
Kathy
 
eswar kumar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanQ Kathy thanQ very much for ur quick reply
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(This is the part of the movie where the deputy standing behind the sherriff starts nervously wringing his cowboy hat in his hands and says, sotto voce, "umm, Sherriff??")
Actually, different containers DO have a default transaction attribute. The issue here is that the entire assembly-descriptor is optional (see Chapter 22 of the EJB spec) -- a deployer does not have to choose to provide one, thus leaving the issue of what transaction context is in use for any method "up in the air".
So, the vendors get to determine which one they want to use as the default. WebSphere, for instance, uses "required" when no container-transaction method is provided.
Kyle
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kyle Brown:

Actually, different containers DO have a default transaction attribute.
....So, the vendors get to determine which one they want to use as the default. WebSphere, for instance, uses "required" when no container-transaction method is provided.
Kyle

Howdy -- well, I reckon I'll have to pull my virtual gun out of my virtual holster and say, "I don't think so..." (Actually, I'm not 1000% sure , but I'm pretty darn sure.)
I believe that while the assembly info is *technically* optional, it is indeed required in certain circumstances, one of which is in the use of CMT. And my point is that the EJB spec does *not* define a default attribute. The fact that most (if not all) deployment tools (and by that I mean the vendor-supplied tools used for your Container) can or will supply one is not dictated by the spec.
So, the spec does not specify any particular default transaction attribute, but it does specify the methods for which a CMT bean MUST have an attribute. And the spec does *not* say that the Container is responsible for providing the default attributes. In fact, the spec *does* say that the Deployer MUST provide transaction attributes (section 17.5) if the App Assembler hasn't already done so. In other words, it is a Deployer responsibility to provide the attributes, even though the Container's vendor-provided tools might do it for the deployer.
But I think the spec goes out of its way in some cases to be vague and ambiguous and confusing, and in some cases contradictory
I can't say that I have memorized each piece of the spec, though, so I still might be missing something...
Still, I guess the bottom line is that if the question is, "What is the default transaction attribute", the answer is, "There isn't one specified by the EJB spec." The fact that a vendor's deployment tool *can* have its own default is not part of the spec. And I know that earlier versions of the J2EE RI would not allow you to deploy unless you had specified each attribute for each method that required one...
What do you think? Is there really a place that says the Container is responsible for this? Because I couldn't find that, but I *did* find a place where it says the Deployer *is* responsible. Hmmmm... now you have me thinking, though.
cheers,
Kathy
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kathy Sierra:

...I guess the bottom line is that if the question is, "What is the default transaction attribute", the answer is, "There isn't one specified by the EJB spec." The fact that a vendor's deployment tool *can* have its own default is not part of the spec.

I'll absolutely agree to that statement! This is one of the parts where the spec is (as you put it) vague, ambiguous, confusing, and contradictory.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!