Update partial entity fields feature like hibernate's dynamic-update

101 views
Skip to first unread message

Rick Rivers

unread,
Mar 14, 2017, 3:24:10 PM3/14/17
to Ebean ORM
Is there such a feature for Ebean?
I reckon this could boost performance quite alot.

Daryl Stultz

unread,
Mar 14, 2017, 3:26:40 PM3/14/17
to eb...@googlegroups.com
On Tue, Mar 14, 2017 at 3:24 PM, Rick Rivers <sriv...@gmail.com> wrote:
Is there such a feature for Ebean?
I reckon this could boost performance quite alot.

I might be able to answer the question, but I'm not familiar with Hibernate. Can you describe the feature?

/Daryl

Rob Bygrave

unread,
Mar 14, 2017, 10:52:56 PM3/14/17
to ebean@googlegroups
> Is there such a feature for Ebean?

Yes, it is on by default. That is, Ebean by default only updates changed fields.  We can turn this off on a transaction basis via:

transaction.setUpdateAllLoadedProperties(true);

... we would chose to do this for jdbc batch processing (to get hits on the PreparedStatement cache, ie. use the same preparedStatement for many updates being executed via jdbc batch).



--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Bygrave

unread,
Mar 14, 2017, 10:56:56 PM3/14/17
to ebean@googlegroups
I should clarify that ServerConfig updateAllPropertiesInBatch ... controls the default behavior when using jdbc batch.  By default this is true meaning updates executed in JDBC batch mode WILL include all loaded properties.

So the default is ... non-jdbc batch - update includes only changed properties,   jdbc batch - update includes all loaded properties (to enable preparedStatement reused).

... and use transaction.setUpdateAllLoadedProperties(...); ... to control the behavior on a per transaction basis.


Cheers, Rob.

Reply all
Reply to author
Forward
0 new messages