Question : Hibernate slows down Tomcat?

I am running hibernate batch insert of 2 million records from within Tomcat. (It should have been implemented in other way, but it is too late now). The problem is that while that thread is running (priority 3) it slows down Tomcat significantly, average response time for page to come up jumps up to 30 seconds.  It runs on Windows Server 2003, 64 bit. JVM is HotSpot 64 bit server (1.6.0_13). Amount of RAM allocated for Tomcat - 15Gb. Server has 32Gb. Server has 4 dual core processors, thread which runs batch insert occupies one core of one processor.

I need to push that thread somewhere in a back, it can run as long as it likes, I just need it not to hijack Tomcat in general.

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
piece of jsp
...					
				MyClass parser = new MyClass(...);
					
				Thread myThread1 = new Thread(parser);
				myThread1.setPriority(3);
				myThread1.start();
...
 
piece of Hibernate config file
 
...
        false
        false
        50 
        true
...

Answer : Hibernate slows down Tomcat?

OK, I've figured out the solution to my problem. The way not to let Hibernate to strangle Tomcat is to flush Hibernate session periodically. When I set it to flush after every 1000 saves into session everything started to work smoothly.
Random Solutions  
 
programming4us programming4us