I am running a load test for a performance-sensitive operation and I'm surprised
by the number of SQL calls I am seeing, so I want to check that I have the JPA
and OpenJPA config set up right.
Hopefully someone can say if any of the SQL calls are avoidable.
This is the entity model:
CollatedAnalysis -> Trade -> Balance
The operation, CollatedAnalysis.analyze(), causes the entity to run over its
large collection of Trade entities, producing a new 'grandchild' Balance entity
for each Trade.
What happens in terms of SQL hits is this:
select all Balance where Trade = ? (because I put the Balance in Trade.balances)
insert Balance
update Trade
For the load test I run the operation on 30K trades - naively I thought I would
only see 30K inserts - is there any way to avoid the other 2 operations?
Thanks
Adam