Hi,
I am running Hibernate Entity Manager 3.1beta7 with MySQL v5. (using either 3.1.12 and 5-beta J/Connector JDBC Driver, same error).
What happens is that during a very long transaction (batch import), I get a OutOfMemory exception.
=== Yes, I do flush() and clear() regularly, every 10,000 entries, but I also tried with 1000 and 500.
I also disabled both query level cache and 2nd-level cache
====
The weird thing is that when doing the same with Derby DB, I get no exception.
So
1) The problem doesn't seem to come from my code
2) The problem doesn't seem to come from your code
=> The problem might be a the JDBC MySQL Memory Leak bug
Googling gives that :
http://bugs.mysql.com/bug.php?id=5022
So, what appears here is that the MySQL bug only appears when the Statement is NOT closed(), which should always be done.
That's why I ask something on this forum :
Does hibernate correctly closes Statements ? I tried searching in the code, but got lost....
Thanks a lot for your help,
Sami Dalouche