We are using Hibernate, C3P0, and MySQL to back an application that uses a Coherence cache. At times, long queries will cause Coherence to barf. In an ideal world, we would be able to configure something in the db layer to time out and throw an exception if a query was taking an exceptionally long time.
However, as I understand it from my research, that is not possible. I'm just looking for confirmation that I haven't overlooked anything. :)
My understanding is that neither Hibernate nor C3P0 provide a query-time function. JDBC's statement does provide a setQueryTimeout, but that is not exposed.
I could, potentially, configure MySQL to think these long queries are deadlocks by setting 'innodb_lock_wait_timeout', which would then cause them to throw an exception.
Does that sound about right? Anything I'm missing?
Thanks.
tj
|