• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate template puts a lock on database after 5-6 calss to it.

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am using Spring2.0 and hibernate 3.2. I take the application context in the following manner, as I am not using the Spring's dependency Injection.

static ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"});

static SessionFactory sessionFactory = (SessionFactory) ctx.getBean("sessionFactory");

Now I don't know where I am committing mistake but when I call a hibernate function for 5-10 times, then a lock is put on the databse, it never retrieves any data. And no exception or error is thrown. Can anyone help me here as what should I do to correct this problem.
 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
I guess I configured it out. I put these lines in my applicationContext.xml and it did the wonder.

<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="10000"></property>

It will also work in normal Spring/Hibernate configurations. Hope it may help someone else.

 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!