JPA Entity as JSF Bean?

You could do so. It’s technically possible. But it does (design)functionally not make any sense. You’re basically tight-coupling the model with the controller. Usually the JPA entity (model) is a property of a JSF managed bean (controller). This keeps the code DRY. You don’t want to duplicate the same properties over all place, let alone … Read more

Improving bulk insert performance in Entity framework [duplicate]

There is opportunity for several improvements (if you are using DbContext): Set: yourContext.Configuration.AutoDetectChangesEnabled = false; yourContext.Configuration.ValidateOnSaveEnabled = false; Do SaveChanges() in packages of 100 inserts… or you can try with packages of 1000 items and see the changes in performance. Since during all this inserts, the context is the same and it is getting bigger, … Read more

What is the difference between persist() and merge() in JPA and Hibernate?

JPA specification contains a very precise description of semantics of these operations, better than in javadoc: The semantics of the persist operation, applied to an entity X are as follows: If X is a new entity, it becomes managed. The entity X will be entered into the database at or before transaction commit or as … Read more

tech