Note that there are some explanatory texts on larger screens.

plurals
  1. POMixture of Hibernate and Raw JDBC app is locking up
    text
    copied!<p>I took over a company's Java Web application that stands at 30k lines of code. There are about 20 users on the system. The application originally did raw jdbc sql queries. I have converted some of the SQL to hibernate, but because of time and budget constraints I have not converted all of it. My thinking was that I could do a mixture of the two db interaction methods (hibernate and raw jdbc), while I incrementally migrate the app to all hibernate. It's using c3p0 connection pooling. It uses two pools; one for hibernate and one for the raw jdbc queries. There are some raw jdbc update and insert queries, but they are now all using hibernate's <code>session.doWork(Work work)</code> hook. The db is Microsoft SQL Server '08 R2.</p> <p>The problems we experience with this approach always seem to manifest themselves as the app locking up. For the past month, I have been able to reduce the frequency of lock-ups by fixing obvious problems. I am at a point now, where the cause is not so obvious, and my boss and I suspect that there is something fundamentally wrong in our approach or configuration that would solve this problem entirely.</p> <p>One thing that is confusing to me is that if these lock-ups are db deadlocks, the thread dumps only seem to indicate that a write is blocking a read. However, the transaction isolation level is read-committed, so why would a write block a read?</p> <p>Are there any suggestions you can give? Any suggestions for better debugging analyis?</p> <p>Here are is the properties from my persistence.xml file</p> <pre><code>&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt; &lt;property name="hibernate.archive.autodetection" value="class, hbm"/&gt; &lt;property name="hibernate.c3p0.min_size" value="20" /&gt; &lt;property name="hibernate.c3p0.max_size" value="300" /&gt; &lt;property name="hibernate.c3p0.timeout" value="300" /&gt; &lt;property name="hibernate.c3p0.max_statements" value="50" /&gt; &lt;property name="hibernate.c3p0.idle_test_period" value="3000" /&gt; </code></pre> <p>I'm using the default c3p0 configuration for the raw jdbc select queries</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload