a quick way is:

instead of creating a service, make something like this

@CommitAfter
private void saveThem(List<Myobjt> lst) {

// put code here to save objects, don't beging a transaction as it has been
started by Tapestry-Hibernate

}

how long?




James Sherwood wrote:
> 
> Hello,
> 
> It took 13 seconds to create the List with 14000 objects.
> 
> At 1 hour 45 minutes I was at 8600 records committing each one.
> 
> For the service, I haven't went that far in T5 yet so I will have to look
> it
> up.
> 
> If there was a way to save the whole list at once using the session that
> might be faster as well.
> 
> --James
> 
> -----Original Message-----
> From: Angelo Chen [mailto:angelochen...@yahoo.com.hk] 
> Sent: January-15-09 9:33 PM
> To: users@tapestry.apache.org
> Subject: [Spam Rating:3.18] Re: T5 and hibernate slowing with more records
> 
> 
> Hi James,
> 
> I do not see any reason why it is slow, but would suggest to do following:
> 
> 1) try to put everything into a list of objects without saving to the
> database, slow? 
> 2) use a service to accept the list from #1, beging a transaction, save,
> commit, slow?
> 
> 
> Angelo
> 
> 
> James Sherwood wrote:
>> 
>> Hello,
>> 
>>  
>> 
>> I am using POI to take an excel file and put it into a Mysql database
>> using
>> hibernate.
>> 
>>  
>> 
>> I put a counter on the records going into the database and it starts off
>> fast but then slows to over 15 seconds a record and I cannot figure out
>> why.
>> 
>>  
>> 
>> My code is basically this:
>> 
>>  
>> 
>> Public class DatabaseDump{
>> 
>>  
>> 
>>                 @Inject
>> 
>>                 Private Session _session;
>> 
>>  
>> 
>>                 Public void onAction(){ //they hit the go button
>> 
>>                                 Loop rows{
>> 
>>                                                
>> _session.beginTransaction();
>> 
>>                                                 Loop cells{
>> 
>>                                                                 Fill the
>> object from the cells
>> 
>>  
>> _session.save(Object);
>> 
>>                                                 }
>> 
>>  
>> _session.getTransaction().commit();
>> 
>>                                 }
>> 
>> }
>> 
>>  
>> 
>> Everything works fine as in the database gets filled for the rows it has
>> completed but gradually slows to a crawl and at around 2700 records of
>> 10500
>> records it's a record every 15 seconds.
>> 
>>  
>> 
>> I run the project under eclipse using Tomcat.  The memory starts at
>> around
>> 80mb and only goes up to around 110mb.
>> 
>>  
>> 
>> What am I doing wrong?
>> 
>>  
>> 
>> --James
>> 
>>  
>> 
>>  
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/T5-and-hibernate-slowing-with-more-records-tp21483684p
> 21490838.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-and-hibernate-slowing-with-more-records-tp21483684p21491243.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to