Ebean performance options

194 views
Skip to first unread message

Chris

unread,
Sep 20, 2012, 5:24:15 PM9/20/12
to eb...@googlegroups.com
Hi All

I'm using Ebean for my application. It relies on a large amount of data to be loaded on first-time installation/run. My scenario is as follows:

1- obtain a list of beans
2- execute a number of transformations on them.
3- save bean

I'm using the batch functionality, with transaction isolation set to read_uncommitted (no users using the app at the time of loading/transforming). 

I'm seeing a performance slow down on step 2.

This seems to occur the first time a setter is called on the Enhanced beans, about 20ms / entity. Obviously the number is quite small, but my transformations take nano-seconds. Since I have approximately 35'000 entries to process, this results in a fairly significant wait.  For example, ~419s for 18000 entries, and so on.

I was wondering if there is anyway to disable the enhancing temporarily on the bean? (option 1) 
Perhaps copying the properties across to a new bean beans that intercepting is off at first...? (option 2)

I guess I'd prefer to do option 1.

Any thoughts? Also, as a separate thought, it's not possible to do batch operations without a current transaction. Perhaps that's a new feature? for example, for some operations you don't really care about the rollback opportunities...

Chris








mbell697

unread,
Sep 24, 2012, 12:49:22 PM9/24/12
to eb...@googlegroups.com
If its only a first time run I would probably just create a script to generate the needed SQL then run the SQL on startup.  This will be much faster.

> Also, as a separate thought, it's not possible to do batch operations without a current transaction. Perhaps that's a new feature? for example, for some operations you don't really care about the rollback opportunities...

Almost all databases that support transactions also require transactions.  Times when you don't explicitly define a transaction Ebean is creating one for you behind the scenes.  How are you getting to batch mode without using a transaction anyway?  Its exposed as part of the Transaction API.  Are you setting batch mode globally somehow? 

Cheers,

Mark

Chris

unread,
Sep 26, 2012, 11:35:33 AM9/26/12
to eb...@googlegroups.com
Agreed on all counts - I've written bits of it to generate the SQL directly. I was using batch with the transaction-framework. But all I was saying was that it would be nice to be able to use the batch functionality specifically outside of a transaction.

Chris
Reply all
Reply to author
Forward
0 new messages