Re: [JBoss-user] JBoss Transaction Problems

2003-07-24 Thread Dan Christopherson
Per the EJB spec, throwing an application exception doesn't cause a 
rollback. call setRollbackOnly on the bean's context object.

Nikolay Ganev wrote:
hi all,

I tried to test CMT using JBoss.
I made simple example using Session Statefull Bean updating the
database...
there is method that intentionally throwing exception - and i hoped
that all changes will be rollback but they didnt
i send u some code and XML settings:
method:
.
updateChecking(checkingBalance);
if (checkingBalance  0.00)
{
context.setRollbackOnly();
throw new InsufficientBalanceException();
}
.
in ejb-jar.xml
container-transaction
method
description /
ejb-nameBank/ejb-name
method-name*/method-name
/method
trans-attributeRequired/trans-attribute
/container-transaction
   could anyone help me why this transaction doesnt work?

  





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


RE: [JBoss-user] JBoss Transaction Problems

2003-07-24 Thread Danny . Yates
What, you mean like the line immediately above where he threw the
exception?  :-)

-- 
Danny Yates
 


-Original Message-
From: Dan Christopherson [mailto:[EMAIL PROTECTED] 
Sent: 24 July 2003 15:27
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] JBoss Transaction Problems


Per the EJB spec, throwing an application exception doesn't cause a 
rollback. call setRollbackOnly on the bean's context object.

Nikolay Ganev wrote:
 hi all,
 
 I tried to test CMT using JBoss.
 I made simple example using Session Statefull Bean updating the
 database...
 there is method that intentionally throwing exception - and i hoped
 that all changes will be rollback but they didnt
 i send u some code and XML settings:
 method:
 .
 updateChecking(checkingBalance);
 if (checkingBalance  0.00)
 {
 context.setRollbackOnly();
 throw new InsufficientBalanceException();
 }
 .
 
 in ejb-jar.xml
 container-transaction
 method
 description /
 ejb-nameBank/ejb-name
 method-name*/method-name
 /method
 trans-attributeRequired/trans-attribute
 /container-transaction
 
could anyone help me why this transaction doesnt work?
 
   
 




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity. 

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, Banc of America Securities Limited and Banc of America
Futures Incorporated are regulated by the Financial Services Authority.
_ 




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] JBoss Transaction Problems

2003-07-24 Thread Erik Price


Nikolay Ganev wrote:
hi all,

I solved my problem!! the problem was in the database - i use MySQL
4.1. I tried the same example using MSSQL2000 and it works!!
can anybody tell me what to do in order to run transaction on MySQL???
You need to use InnoDB table type, not MyISAM.

http://www.mysql.com/doc/en/ANSI_diff_Transactions.html



Erik



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user