|
Since count is a simple int, could this be a concurrency issue? Our usecase is essentially reading a large (12M+ rows) csv file from which entities are either updated or inserted.
I can only imagine that there is some form of unsafe access to the Session from multiple Threads (we do use 2 Threads) and places where count is modified aren't synchronized.
If this is the cause, Hibernate devs will tell us to RTFM, but the simple potential fix would be to use an AtomicInteger for count.
|