RE: get reference to UserTransaction fails

2000-10-25 Thread Juan Lorandi (Chile)

a) yes, I do call Entity Beans directly... no programatic security there
(yet, but can be acomplished especially with CMP, which is what I work with)
yes I also place some BL within Session Beans with a facade pattern...

b) Yes, you may use session beans not only as in a facade pattern, but also
in a Activity-Owner pattern:

Stateful SB  - Stateless SB - Entity Beans

TransactionRoot  -  Facade/BL   - Persistence

in this pattern, you have an object which its purpose is transaction
demarcation

remember that transaction demarcation is best done at tier boundaries


My 2c,

JP


-Original Message-
From: Greg Matthews [mailto:[EMAIL PROTECTED]]
Sent: Martes, 24 de Octubre de 2000 21:08
To: Orion-Interest
Subject: Re: get reference to UserTransaction fails



i was trying to do the same thing, and it sort of makes
sense that you can't control a transaction (UserTransaction)
from outside orion (i.e. the ejb container).

it does raise the question however about how you would
ever maintain any decent level of control over transactions
if entity beans were involved unless you *always*:

1. set the trans-attribute of every entity bean to Mandatory
2. used stateless session beans as a facade to controlling
   entity beans.

i've been using stateless session beans for a while and trying
to come up to speed with entity beans. there's probably
something stupid i'm doing but i've been unable to find
a solid way to control database transaction boundaries
unless i use the above pattern (slsb call entity beans).

a) does anyone call entity beans directly from a JSP?
or do you call stateless server beans which wrap entity beans?

b) is it possible to control database transaction boundaries
without wrapping EJB methods calls in a UserTransaction.begin()
and UserTransaction.commit() ?

thanks,
greg


- Original Message -
From: "Juan Lorandi (Chile)" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Wednesday, October 25, 2000 3:49 AM
Subject: RE: get reference to UserTransaction fails


 Are your trying to retrieve something from "java:comp" DIRECTLY from code
 not running on Orion?

 I have looked (very quickly) at the specs, and I don't think that's
 allowed(seems pretty unsafe to me)
 Perhaps you can build a session bean that preforms the lookup, then passes
 the reference to the client

 flamebait
 But I think it's a bad idea anyway... it's kinda like "one and a half"
layer
 programming...
 /flamebait

 My 2c,

 JP

 -Original Message-
 From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
 Sent: Martes, 24 de Octubre de 2000 7:10
 To: Orion-Interest
 Subject: get reference to UserTransaction fails


 Hello,

 i'm using transactions within servlets, sessionbeans
 with no problems.

 now i'm trying this from an ordinary app-client but it
 caught an exception:
"java:comp/UserTransaction not found"

 what goes wrong?

 thanks a lot
   klaus


  import javax.naming.*;
  import javax.transaction.*;
  ...
  TransactionManager tm =
(TransactionManager)new
 InitialContext().lookup("java:comp/UserTransaction");

 --
 Klaus Thiele - Personal  Informatik AG
 mailto:[EMAIL PROTECTED]

  "There's got to be more to life than compile-and-go."







get reference to UserTransaction fails

2000-10-24 Thread Klaus Thiele

Hello,

i'm using transactions within servlets, sessionbeans
with no problems.

now i'm trying this from an ordinary app-client but it
caught an exception:
   "java:comp/UserTransaction not found"

what goes wrong?

thanks a lot
  klaus


 import javax.naming.*; 
 import javax.transaction.*; 
 ... 
 TransactionManager tm =
   (TransactionManager)new
InitialContext().lookup("java:comp/UserTransaction");

--
Klaus Thiele - Personal  Informatik AG
mailto:[EMAIL PROTECTED]

 "There's got to be more to life than compile-and-go."




Re: get reference to UserTransaction fails

2000-10-24 Thread Joe Walnes


now i'm trying this from an ordinary app-client but it
caught an exception:
"java:comp/UserTransaction not found"

In the JNDI properties, are you specifying the application name as well as 
the server? e.g.

java.naming.provider.url=ormi://localhost/myapp (Correct)
java.naming.provider.url=ormi://localhost   (Wrong)

-Joe Walnes





RE: get reference to UserTransaction fails

2000-10-24 Thread Juan Lorandi (Chile)

Are your trying to retrieve something from "java:comp" DIRECTLY from code
not running on Orion?

I have looked (very quickly) at the specs, and I don't think that's
allowed(seems pretty unsafe to me)
Perhaps you can build a session bean that preforms the lookup, then passes
the reference to the client

flamebait
But I think it's a bad idea anyway... it's kinda like "one and a half" layer
programming...
/flamebait

My 2c,

JP

-Original Message-
From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
Sent: Martes, 24 de Octubre de 2000 7:10
To: Orion-Interest
Subject: get reference to UserTransaction fails


Hello,

i'm using transactions within servlets, sessionbeans
with no problems.

now i'm trying this from an ordinary app-client but it
caught an exception:
   "java:comp/UserTransaction not found"

what goes wrong?

thanks a lot
  klaus


 import javax.naming.*; 
 import javax.transaction.*; 
 ... 
 TransactionManager tm =
   (TransactionManager)new
InitialContext().lookup("java:comp/UserTransaction");

--
Klaus Thiele - Personal  Informatik AG
mailto:[EMAIL PROTECTED]

 "There's got to be more to life than compile-and-go."




Re: get reference to UserTransaction fails

2000-10-24 Thread Greg Matthews


i was trying to do the same thing, and it sort of makes
sense that you can't control a transaction (UserTransaction)
from outside orion (i.e. the ejb container).

it does raise the question however about how you would
ever maintain any decent level of control over transactions
if entity beans were involved unless you *always*:

1. set the trans-attribute of every entity bean to Mandatory
2. used stateless session beans as a facade to controlling
   entity beans.

i've been using stateless session beans for a while and trying
to come up to speed with entity beans. there's probably
something stupid i'm doing but i've been unable to find
a solid way to control database transaction boundaries
unless i use the above pattern (slsb call entity beans).

a) does anyone call entity beans directly from a JSP?
or do you call stateless server beans which wrap entity beans?

b) is it possible to control database transaction boundaries
without wrapping EJB methods calls in a UserTransaction.begin()
and UserTransaction.commit() ?

thanks,
greg


- Original Message -
From: "Juan Lorandi (Chile)" [EMAIL PROTECTED]
To: "Orion-Interest" [EMAIL PROTECTED]
Sent: Wednesday, October 25, 2000 3:49 AM
Subject: RE: get reference to UserTransaction fails


 Are your trying to retrieve something from "java:comp" DIRECTLY from code
 not running on Orion?

 I have looked (very quickly) at the specs, and I don't think that's
 allowed(seems pretty unsafe to me)
 Perhaps you can build a session bean that preforms the lookup, then passes
 the reference to the client

 flamebait
 But I think it's a bad idea anyway... it's kinda like "one and a half"
layer
 programming...
 /flamebait

 My 2c,

 JP

 -Original Message-
 From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
 Sent: Martes, 24 de Octubre de 2000 7:10
 To: Orion-Interest
 Subject: get reference to UserTransaction fails


 Hello,

 i'm using transactions within servlets, sessionbeans
 with no problems.

 now i'm trying this from an ordinary app-client but it
 caught an exception:
"java:comp/UserTransaction not found"

 what goes wrong?

 thanks a lot
   klaus


  import javax.naming.*;
  import javax.transaction.*;
  ...
  TransactionManager tm =
(TransactionManager)new
 InitialContext().lookup("java:comp/UserTransaction");

 --
 Klaus Thiele - Personal  Informatik AG
 mailto:[EMAIL PROTECTED]

  "There's got to be more to life than compile-and-go."