hi, i am using jboss 3.2.5, mysql 4.0, Eclipse 2.1, lomboz 2.1
code snippet:
/**
* @ejb.interface-method
* @ejb.transaction type="Required"
*/
public void processPass (Hashtable order) throws Exception {
insertUser(); //db connection is fine. succeed all the time
try {
processOrder(order); //i made this throw a fileNotFound exception
} catch (Exception e) {
e.printStackTrace();
ctx.setRollbackOnly();
//coz processOrder() fails, i expect insertUser()
//rolls back...but it never happened }
}
i can not figure out what is wrong. here are my config files:
{jboss_home}/server/default/config/jboss-service.xml never been changed
{jboss_home}/server/default/deploy/transaction-service.xml never been changed
{jboss_home}/server/default/deploy/mysql-ds.xml is like this:
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/mytest</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<pass---word>1234</pass---word>
</local-tx-datasource>
did i miss anything in datasource config file? what extra step(s) do i need to set the transaction support in jboss? any difference about tx between 3.2.5 and 4.0 ?
thanx
Moderated FAQ: Use a database/table implementation that actually supports transactions.