ok let me more specific...
I am reading a xml file
then from this xml file I am creating objects and inserting this objects to the list.
After file read is finished, I am inserting every object to the database.
Since list have many objects(about 15000-20000), I want to insert object after read is completed.
Because read/insert one by one increases the operation time.
although it would be better to understand why your code is doing something it shouldn't be
I did not understand what you mean in here?
I am not doing anything wrong, I guess
Because the objects I want to save are different from each others however I am getting this error.
Online, I found some information that implies;
The cause is that object user1 is in detached state and is used in the second transaction to store the object, whilst there is already another object accociated. If you would not load object user2 the exception does not occur.
By the way, I wrongly clicked the "Resolved" button