From: <leg...@at...> - 2004-10-26 11:42:57
|
Message: The following issue has been resolved as WON'T FIX. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HB-1246 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-1246 Summary: HILO id can cause deadlock Type: Bug Status: Resolved Priority: Major Resolution: WON'T FIX Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Versions: 2.1.6 Assignee: Reporter: Edward Costello Created: Thu, 30 Sep 2004 1:02 AM Updated: Tue, 26 Oct 2004 7:18 AM Environment: HILO id generation with a fixed connection limit Description: The HILO generator attempts to obtain a connection to the database in addition to the one being used by the current session. If no connections are available and all sessions are attempting an operation that requires ID generation, this will result in deadlock (at least until the connection pool times out the request and the exception kills one of the requesting sessions). The simple case to observe this effect is: 1) Set up the connection pool to provide only a single connection. 2) Attempt to save an object using HILO id generation. This issue can also occur when there is more than one connection available. E.G if there are 5 connections, 5 threads open a session, all 5 attempt to save. All 5 threads will be blocked while they each try and obtain a connection for the id generator. --- Code to Reproduce --- Configuration cfg = new Configuration(); cfg.configure(......); // Configured Pool must only allow 1 connection SessionFactory sf = cfg.buildSessionFactory(); Session s = sf.openSession(); Transaction tx = s.beginTransaction(); s.save(new PersistedObject()); tx.commit(); ---- Suggested Resolution --- The best solution we have come up with is to allow for the configuration of a second smaller connection pool that is used exclusively for HILO (and any other generation types requiring a separate connection). This pool would be optional and if not specified the main pool would be used (i.e. the current behaviour). --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |