0 Replies Latest reply on May 27, 2005 7:51 AM by Matthew Checkon

    Commit Data from a servlet to MySQL

    Matthew Checkon Newbie

      Hello,


      I am relatively new to JBoss and Java, so please bear with me.

      I am working with a servlet that receives data from a client program, increments a counter, updates the counter to a MySQL table/field, and reports the new counter back to the client for storage until the next communication.

      All comms are working fine, but the update to MySQL seems to be cached in JBoss instead of writing directly back to the database. The value is not accessible in MySQL until I re-deploy my EJB app or restart the server. I'm guessing the restart causes the flushing and committing the data out of JBoss.

      It may be important to the discussion to state that I'm using HttpSession attributes through several handshake sequences. The update is supposed to occur in the 2nd handshake, but by the 3rd handshake when I query the db the value has still not been updated.

      How do I commit SQL transactions to a MySQL database, or force the data to flush to MySQL? I realize MySQL doesn't support commit/rollback transactions, so I'm guessing my issue is in the JBoss configuration.

      I appreciate any help you experts can point me to. If you need specifics about my config or setup, please let me know.

      Thank you!

      - Matt