What database are you using? Some database require closing the connection after **each** request in order to have the change propagated into the database. Otherwise, have a look at commit options. You're seemingly using commit options A. Set it into Commit options B, or C ...
I am using Oracle 8i as my database .
I am also closing the connection after each request.
Also where do i set the Commit options ? Is it in
the jboss.jcml file ?
I had tried a workaround which worked,though I am not sure if it is the right approach.It involved using "con.setAutoCommit(true)" after getting the connection.
Thanks and Regards
If you are accessing the datasource directly from a jsp or servlet or mbean you are not participating in the ejb containers transaction management. So you have to manage transactions yourself. One way is by setting autocommit(true), although if you also use these connections from ejbs you will have to remember to set it false before you return. Another possibility is to call commit() on the connection before closing it.
NOTE: THIS ONLY APPLIES TO CONNECTION USAGE WITHIN JSPS OR SERVLETS, NOT BMP EJBS!!
My problem may be the same as yours. I've been hitting my head trying to figure out why I have transaction deadlocks. Basically, I can view and update, but when I try to create, I get a transaction deadlock.
I have the problem both with MySQL and SQL Server. I thought I solved the problem with SQL Server, but then noticed that it never seemed to commit the changes. I can update and add lots of data, only to find when I shut down and restart JBoss, none of it was saved.
This explains my deadlock problem. If it is never commiting, then naturally a transaction deadlock can occur. Does anyone have any idea why it wouldn't commit?
I switched to commit-option B to solve an earlier problem, from A. I tried every transaction isolation option available. I originally had the trans-attribute for all methods set to Required, later changing it to match a BMP example.
In the example, all Home methods were set to "NotSupported". Setting the create to "Required" does not appear to have an effect. It should not matter anyway. It should autocommit if a transaction isn't declared. Can someone help, please?
Thanks for the Tip,it's making sense now
you'll need a XADataSourceLoader in your jboss.jcml ... Then transactions will be committed