[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Simple EJB question

Lister321 do-not-reply at jboss.com
Sat Nov 15 06:46:03 EST 2008


Hi,

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!

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

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



More information about the jboss-user mailing list