-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: configure connection pool and ID generator for faster insert
PostPosted: Mon Sep 26, 2005 2:36 pm 
Newbie

Joined: Tue Sep 06, 2005 12:10 pm
Posts: 5
Hello,

I have been searching for approaches to improve inserting performance with Hibernate in the past several days, Here are some suggestions I found:

Quote:
inserting data to DB can be very fast under Hibernate. Using Hibernate and Oracle we have achived about 2000 inserts/sec.
But you have to remember about few things:

1) Do not use default connection pool
2) make clear after 100-200 inserts
3) gnerate ID yourself (under Oracle Hibernate do it very very poor)
4) make commit after let say 1000-10000 inserts


Since I am pretty new to Hibernate, I would like to ask help on following issues? Examples and direction pointing are highly appreciated.


1) How to configure a connection pool other than the default one?
2) What's the best and easiest approach to generate ID without using those default ID generators? ( I am using Oracle and Hibernate, for each row, it seems that a select statement is generated to get the next id when I use the sequence ID generator)


Thanks so much and have a great day,

Jiao


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 12:31 pm 
Pro
Pro

Joined: Fri Sep 02, 2005 4:21 am
Posts: 206
Location: Vienna
To configure a connection pool define hibernate.connection.provider_class. For example:
Code:
<property name="hibernate.connection.provider_class">
   org.hibernate.connection.C3P0ConnectionProvider
</property>

Take a look at http://www.hibernate.org/hib_docs/v3/re ... ernatejdbc for more information.
But note that things can be quite different if you use an application server.

Concerning Id generation: you can use other generators like hilo or seqhilo. Take a look at http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#mapping-declaration-id-generator

Erik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.