I'm using JBoss 3.2.5 as my application server. I had developed a Stateless Session Bean. In my Session Bean, I try to create a connection to my MSSQL Database via following code :
InitialContext initialcontext = new InitialContext();
DataSource dataSource = (DataSource)initialcontext.lookup("jdbc/myDatabase");
Connection conn = dataSource.getConnection();
System.out.println("Auto Commit Mode : " + conn.getAutoCommit());
what's strange is the auto commit mode is defaulted to false. But if i use the same code in servlet, the default auto commit mode is true. Can someone please explain to me why it is like that??