EJB programming & troubleshooting: Will update to single field of entity bean, update ENTIRE row?

  1. Hello, If I have an EJB3 entity bean that maps to a single table, and I change the value of a single field in the entity bean, will JUST the column in the row be updated, or will each column in the row be updated? In other words, even the values that did not change will be updated....? Keith
  2. It depends on your EJB3 impelementation and the brand of your target database. If you, for example, use Hibernate as a EJB3 entities implementation, Hibernate will optimize your statements depending of which database you are using, allowing for the best performance. Different databases will perform differently during update statements, and some will perform better if updating all fields, and others don't. As an example, Hibernate will update all fields even if only one is dirty when running on Oracle 9. Regards N