user transaction

L

Lew

gk said:
Here is a code from Mastering Enterprise Java Bean which Idon't
understand . Could you please clarify this doubt ?

Here is the excerpt
http://i218.photobucket.com/albums/cc298/curseofgoldendragon/usertransaction.png

Assuming the comments in red are yours, here are my answers:

- Yes, pretty much.
- Yes, those have it.
- No.
- Yes. But they must support a rollback mechanism.

Additional commentary:
- The JNDI name is whatever you configure it to be. It doesn't have to be
"UserTransaction".
- Read up on JNDI. (That's a strong suggestion.)

P.S., it's better to just quote something this short in your post rather than
making a graphic and linking to it. You can just use the clipboard to paste
the code into your post. I don't even begin to understand why you did it that
way. Plus, it'd make it much easier to respond inline if you had used text.
 
G

gk

You can just use the clipboard to paste
the code into your post. I don't even begin to understand why you did it that
way.  Plus, it'd make it much easier to respond inline if you had used text.

Thats because I was reading from "Google Books" . There was no text to
copy to clipboard...it was in graphic form.

thanks for your post.
"UserTransaction".

my question for this was little different . What I meant is , whether
there is a spec that application servers have to employ a JTA service
MANDATORY so that developer can get a handle of it .
Yea , I understand this does not have to be the text "UserTransaction"
Always.
 
L

Lew

gk said:
my question for this was little different . What I meant is , whether
there is a spec that application servers have to employ a JTA service
MANDATORY so that developer can get a handle of it .

No, it's not mandatory, but it's pretty near universal, including for
the products you specifically mentioned. That's what I meant by,
"Yes, pretty much" and "Yes, those have it". Tomcat does not, AFAIK.

A few minutes with the docs for the products about which you asked
will clarify matters. Reading the ... manual is always recommended.
 
A

Arne Vajhøj

my question for this was little different . What I meant is , whether
there is a spec that application servers have to employ a JTA service
MANDATORY so that developer can get a handle of it .

JTA is required by the Java EE spec, so any compliant Java EE
app server will support JTA.

Arne
 
A

Arne Vajhøj

No, it's not mandatory, but it's pretty near universal, including for
the products you specifically mentioned. That's what I meant by,
"Yes, pretty much" and "Yes, those have it". Tomcat does not, AFAIK.

It does not.

But then Tomcat does not support EJB's at all.

Arne
 
A

Arne Vajhøj

Here is a code from Mastering Enterprise Java Bean which Idon't
understand . Could you please clarify this doubt ?

Here is the excerpt
http://i218.photobucket.com/albums/cc298/curseofgoldendragon/usertransaction.png

1) Yes. Any fully compliant Java EE app server (any compliant
EJB container) must support JTA for EJB's with bean managed
transactions.

2) No. Anything that can participate in XA transactions can be used:
database (JDBC drivers), message queues (JMS providers),
EIS systemer (JCA connectorer).

Arne
 
A

Arne Vajhøj

Additional commentary:
- The JNDI name is whatever you configure it to be. It doesn't have to
be "UserTransaction".

It does.

From the EJB spec:

<quote>
The container must make the javax.transaction.UserTransaction interface
available to
the enterprise bean’s business method, message listener method, or
ejbTimeout method via the
javax.ejb.EJBContext interface and under the environment entry
java:comp/UserTransaction.
</quote>

Arne
 
M

Mike Schilling

Arne Vajhøj said:
It does not.

But then Tomcat does not support EJB's at all.

Right. Tomcat is a J2EE-compliant servlet container, but not an EJB
container. Servlets can also make use of JTA, but in Tomcat (at least), the
transaction manager doesn't come with.
 
L

Lew

Mike said:
Right. Tomcat is a J2EE-compliant servlet container, but not an EJB
container. Servlets can also make use of JTA, but in Tomcat (at least),
the transaction manager doesn't come with.

Tomcat can support EJBs if you add Apache OpenEJB.
 
L

Lew

It does.

From the EJB spec:

<quote>
The container must make the javax.transaction.UserTransaction interface
available to
the enterprise bean’s business method, message listener method, or
ejbTimeout method via the
javax.ejb.EJBContext interface and under the environment entry
java:comp/UserTransaction.
</quote>

I stand corrected.
 
L

Lew

1) Yes. Any fully compliant Java EE app server (any compliant
EJB container) must support JTA for EJB's with bean managed
transactions.

He said "all application servers", not "all fully-compliant Java EE
application servers". Tomcat is an application server that is not (natively)
an EJB container, and does not support JTA out of the box.
 
A

Arne Vajhøj

Right. Tomcat is a J2EE-compliant servlet container, but not an EJB
container. Servlets can also make use of JTA, but in Tomcat (at least),
the transaction manager doesn't come with.

Because it is not required in the servlet spec.

Arne
 
A

Arne Vajhøj

He said "all application servers", not "all fully-compliant Java EE
application servers". Tomcat is an application server that is not
(natively) an EJB container, and does not support JTA out of the box.

Neither does Zope (Python), VisiBroker (CORBA) etc..

But given the book mentioned and the code snippet, then
I can't see much relevance for servers without an EJB container.

Arne
 
M

Mike Schilling

Arne Vajhøj said:
Because it is not required in the servlet spec.

Right, as one can conclude from the fact that at least one compliant servlet
container doesn't provide one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top