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