I thought that UserTransaction is not accessible outside of the bean
context? I know in 2.3 beta it's available outside of the JVM even (there's
a whole seperate issue there .. ) ... but with 2.2, I thought that the only
way to give explicit transaction bounds outside of a bean is to use
TransactionManager?

Both my EntityBeans are "Required" transaction attributes ...

   <assembly-descriptor>
      <container-transaction>
         <method>
            <ejb-name>Credit_Card</ejb-name>
            <method-name>*</method-name>
         </method>
         <trans-attribute>Required</trans-attribute>
      </container-transaction>
   </assembly-descriptor>

Thanks

-Dave

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Toby Allsopp
> Sent: Thursday, June 07, 2001 3:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] TransactionManager bug? or is there something
> i'm missing?
>
>
> On Thu, Jun 07, 2001 at 02:01:36PM -0400, David Esposito wrote:
> > Summary:
> > It seems as though my two bean operations are executing under
> different DB
> > connections even though they are encapsulated in a TransactionManager
> > transaction block
> >
> > (and please don't tell me that I have to write a session bean
> ... there are
> > many reasons why this is impractical for my particular
> application ... :-)
> > ... )
> >
> > Detail:
> > I have a servlet (running in EmbeddedTomcat) which does the
> following: It
> > looks up an existing record from the credit_card table, changes the
> > billing_address_id to some other billing address, then attempts
> to remove
> > the old address record from the database ... There is a NON-cascading FK
> > constraint on the credit_card table
> >
> > My environment:
> > Sun JDK 1.3
> > JBOSS 2.3 Beta (5-23-01 build) ... it has also been tested on JBOSS 2.2
> > final and still fails
> > PostgreSQL 7.1.2 on Redhat 7.1
> >
> > Here's my java method ... i tried to make it as brief as
> possible (i cut out
> > most of the details of the exception handling for the rollback)
> >
> > public TemplateWrapper serviceRequest(ServletParams params)
> > {
> >    TransactionManager trans = null;
> >
> >    try{
> >       trans =
> >
> (TransactionManager)getHome("java:/TransactionManager",Transaction
> Manager.cl
> > ass);
>
> You shouldn't use the TransactionManager interface in application
> code.  You
> should use UserTransaction instead.  Or, even better, you should
> use an EJB
> method with container-managed transactions.
>
> That said, I think what you've done will work.
>
> What are the transaction attributes on the EJB methods you're calling?
>
> Toby.
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to