[jboss-user] [Beginners Corner] - Re: Transactions in JBoss

francis17101970 do-not-reply at jboss.com
Tue Sep 9 03:01:10 EDT 2008


Hello,
oh no, don't use Class.forName. Use JBoss Connection pool at first

Context ctx = new InitialContext();
  |          javax.sql.DataSource ds
  |               = (javax.sql.DataSource) ctx.lookup ("myJtsDataSource");
  |          java.sql.Connection conn = ds.getConnection();

You have to register a Datasource and place it in the deploy directory of jBoss. Of course you could write your own Conn Pool and delegate transaction management to the RDBMS but it's lots of work, and then why using an Application Server if you don't use its services ?

Then from your Web Service you can start your own transactions yet I would advice you if you have experience at EJB, handle your business logic in an EJB either BMT or CMT. With EJB 3.0 it's pretty easier, no configuration files are needed to handle transactions.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175212#4175212

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175212



More information about the jboss-user mailing list