1 Reply Latest reply on Nov 26, 2008 5:31 AM by Jimmy Wennlund

    Simple EJB question

    Jeroen Sikking Newbie


      I've been using JBoss for quite a while now, but there is one question that I still haven't found a good answer to:

      I often use EJBs together with a MySQL database. This works fine, but sometimes I want to do a mass update of all the records in a database table. I could of course simply open an EJB instance for each row and update it, but with a million records or more, this will take a very long time, while I can simply issue an UPDATE command in MySQL and do the same thing in a few seconds.

      But if I do an update straight into the MySQL database, any EJBs that are open will be out of sync with the corresponding database records. What I've been doing so far is waiting for a quiet moment to do the update and do a quick redeploy of the application. But I'm sure there must be a better way.

      Can anyone tell me the best way to do something like this?

      Thanks for your help!