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."
>
>


Reply via email to