RE: How can I get UserTransaction or TransactionManager

2001-07-09 Thread HyungKee Hwang

Thank you Heinz.

I tried in other ways to manage a transaction, but I still have other problems about 
Orion TXN.

What I wanted to do in my App. is as follows;

Let's assume that  user class and address class exist and their relationship is 1-to-1.
1. Create a user
2. Create an address object of the user

if creating the address object is failed, I'd like to rollback creating a user.

Trial 1
I used entity bean and session bean to manage the transaction as follows;
1. newUser method is one of the methods of a session bean, and the method's 
transaction attribute is set to RequiresNew
2. newAddress method is one of the methods of User entity bean, and the mehtod's 
transaction attribute is set to Supports
3. newUser method calls newAddress method.
But, even though creating the address failed, creating a user was not rollbacked, i.e. 
new user was still in the database.

Tiral 2
I used ejbContext to get UserTransaction in newUser method of a session bean as 
follows;

ejbContext.getUserTransaction().begin();
create a user
newAddress();
ejbContext.getUserTransaction().commit();
And set the session bean's TXN attribute to Bean

but, the result was the same as above.

Any advice appreciated.
-HK





-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Haeussler, Heinz
Sent: Monday, July 09, 2001 2:32 PM
To: Orion-Interest
Subject: RE: How can I get UserTransaction or TransactionManager

Hi HK,

you can't get UserTransaction from an Application-Client-or
RMI-Client-Context. This (optional) feature is not supported by Orion.

Heinz

-Ursprüngliche Nachricht-
Von: HyungKee Hwang [mailto:[EMAIL PROTECTED]]
Gesendet am: Montag, 9. Juli 2001 02:35
An: Orion-Interest
Betreff: RE: How can I get UserTransaction or TransactionManager

Thank you Aby
I tried java:comp/env/UserTransaction, but the same error occurred.

Any advice appreciated.

Regards,
-HK


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
Sent: Saturday, July 07, 2001 3:47 PM
To: Orion-Interest
Subject: Re: How can I get UserTransaction or TransactionManager


Hi HK,
I think you should try

java:comp/env/UserTransaction

Regards
Aby




HyungKee Hwang [EMAIL PROTECTED]@orionserver.com on 07-07-2001
09:10:55 AM

Please respond to Orion-Interest [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Orion-Interest [EMAIL PROTECTED]
cc:
Subject:  How can I get UserTransaction or TransactionManager


Hello, all.

Can you give me some advice how to get UserTransaction or
TrasactionManger?

I wrote some codes in my application as follows;

 // Below codes are from Orion FAQ
import javax.naming.*;
import javax.transaction.*;
...
TransactionManager manager = (TransactionManager)new InitialContext
().lookup(java:comp/UserTransaction);
I didn't have any problem compiling my codes, but I met below error
while running my application
avax.naming.NameNotFoundException: java:comp/UserTransaction not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
Thank you in advance.
-HK








RE: How can I get UserTransaction or TransactionManager

2001-07-08 Thread HyungKee Hwang

Thank you Aby
I tried java:comp/env/UserTransaction, but the same error occurred.

Any advice appreciated.

Regards,
-HK


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
Sent: Saturday, July 07, 2001 3:47 PM
To: Orion-Interest
Subject: Re: How can I get UserTransaction or TransactionManager


Hi HK,
I think you should try

java:comp/env/UserTransaction

Regards
Aby




HyungKee Hwang [EMAIL PROTECTED]@orionserver.com on 07-07-2001
09:10:55 AM

Please respond to Orion-Interest [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Orion-Interest [EMAIL PROTECTED]
cc:
Subject:  How can I get UserTransaction or TransactionManager


Hello, all.

Can you give me some advice how to get UserTransaction or
TrasactionManger?

I wrote some codes in my application as follows;

 // Below codes are from Orion FAQ
import javax.naming.*;
import javax.transaction.*;
...
TransactionManager manager = (TransactionManager)new InitialContext
().lookup(java:comp/UserTransaction);
I didn't have any problem compiling my codes, but I met below error
while running my application
avax.naming.NameNotFoundException: java:comp/UserTransaction not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
Thank you in advance.
-HK








RE: How can I get UserTransaction or TransactionManager

2001-07-08 Thread aby


Hi HK,
I am getting puzzled now on this.
Maybe you could try UserTransaction ut = context.getUserTransaction();

where 'context' is the SessionContext or EntityContext variable which
is declared at the top of the EJB as a variable.

Kind Regards
Aby





RE: How can I get UserTransaction or TransactionManager

2001-07-08 Thread Haeussler, Heinz

Hi HK,

you can't get UserTransaction from an Application-Client-or
RMI-Client-Context. This (optional) feature is not supported by Orion.

Heinz

-Ursprüngliche Nachricht-
Von: HyungKee Hwang [mailto:[EMAIL PROTECTED]]
Gesendet am: Montag, 9. Juli 2001 02:35
An: Orion-Interest
Betreff: RE: How can I get UserTransaction or TransactionManager

Thank you Aby
I tried java:comp/env/UserTransaction, but the same error occurred.

Any advice appreciated.

Regards,
-HK


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
Sent: Saturday, July 07, 2001 3:47 PM
To: Orion-Interest
Subject: Re: How can I get UserTransaction or TransactionManager


Hi HK,
I think you should try

java:comp/env/UserTransaction

Regards
Aby




HyungKee Hwang [EMAIL PROTECTED]@orionserver.com on 07-07-2001
09:10:55 AM

Please respond to Orion-Interest [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Orion-Interest [EMAIL PROTECTED]
cc:
Subject:  How can I get UserTransaction or TransactionManager


Hello, all.

Can you give me some advice how to get UserTransaction or
TrasactionManger?

I wrote some codes in my application as follows;

 // Below codes are from Orion FAQ
import javax.naming.*;
import javax.transaction.*;
...
TransactionManager manager = (TransactionManager)new InitialContext
().lookup(java:comp/UserTransaction);
I didn't have any problem compiling my codes, but I met below error
while running my application
avax.naming.NameNotFoundException: java:comp/UserTransaction not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
Thank you in advance.
-HK








Re: How can I get UserTransaction or TransactionManager

2001-07-07 Thread aby


Hi HK,
I think you should try

java:comp/env/UserTransaction

Regards
Aby




HyungKee Hwang [EMAIL PROTECTED]@orionserver.com on 07-07-2001
09:10:55 AM

Please respond to Orion-Interest [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Orion-Interest [EMAIL PROTECTED]
cc:
Subject:  How can I get UserTransaction or TransactionManager


Hello, all.

Can you give me some advice how to get UserTransaction or
TrasactionManger?

I wrote some codes in my application as follows;

 // Below codes are from Orion FAQ
import javax.naming.*;
import javax.transaction.*;
...
TransactionManager manager = (TransactionManager)new InitialContext
().lookup(java:comp/UserTransaction);
I didn't have any problem compiling my codes, but I met below error
while running my application
avax.naming.NameNotFoundException: java:comp/UserTransaction not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
Thank you in advance.
-HK