You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a database(Oracle) sequence that increments 100 at a time, sequence mapped with below method so 1000 Entity Save method access calls 10 times to database for new Sequence.nextval.
Wit a stateless session (and adonet.batch_size = 1000, order_updates = true in hibernate.cfg.xml), every 100 + 1 calls, Save triggers the batcher. It's uses same Batcher instance with SequenceStyleGenerator. Why "SequenceStyleGenerator" needs batcher at all, just to reads one line of data?
(With a statefull session (and adonet.batch_size = 1000, order_updates = true in hibernate.cfg.xml), every 100 Save calls just triggers Sequence.nextval. Batcher waits until batch size(1000) to get triggered.)
The text was updated successfully, but these errors were encountered:
gokhanabatay
changed the title
Batch insert when using SequenceStyleGenerator with stateless sessions?
Batch insert adonet.batch_size issue when using SequenceStyleGenerator with Stateless Sessions
Jan 28, 2020
fredericDelaporte
changed the title
Batch insert adonet.batch_size issue when using SequenceStyleGenerator with Stateless Sessions
SequenceStyleGenerator generator badly triggering batcher with Stateless Sessions
Jan 29, 2020
Hi @hazzik sorry for late response, I need to know how to check batcher access count and how to create custom sequence via nhibernate mappings.
But I think issue is clear let me tell you.
In StatelessSessionImpl.Insert method object id = persister.IdentifierGenerator.Generate(this, entity); uses directly Batcher so existing waiting commands will be flushed instant.
In SessionImpl uses ActionQueue so accessing Batcher in AbstractSaveEventListener.SaveWithGeneratedId method object generatedId = persister.IdentifierGenerator.Generate(source, entity) for sequences does not trigger waiting inserts/updates/deletes.
For better batching support I think, identity generators should use different batcher, is it realy necessary use Batcher with identity generators at all?
We have a database(Oracle) sequence that increments 100 at a time, sequence mapped with below method so 1000 Entity Save method access calls 10 times to database for new Sequence.nextval.
Wit a stateless session (and adonet.batch_size = 1000, order_updates = true in hibernate.cfg.xml), every 100 + 1 calls,
Save
triggers the batcher. It's uses same Batcher instance with SequenceStyleGenerator. Why "SequenceStyleGenerator" needs batcher at all, just to reads one line of data?(With a statefull session (and adonet.batch_size = 1000, order_updates = true in hibernate.cfg.xml), every 100 Save calls just triggers Sequence.nextval. Batcher waits until batch size(1000) to get triggered.)
Fluent Mapping:
The text was updated successfully, but these errors were encountered: