yes, when instantiating a JDBC driver it register itself with DriverMAnager that is how Datamapper "tried" to register its drviers. now we removed the use DriverManager and use the JDBC driver directly.
so the problem is not really limited to AR !! any library which loads jdbc drivers via jruby registers them under the jruby classloader in the DriverMAnager I hope the solution for this problem is generic enough that we can use it for datamapper as well with regards Kristian On Wed, Nov 11, 2009 at 3:14 AM, Vivek Pandey <[email protected]> wrote: > > On Tue, Nov 10, 2009 at 7:55 AM, Thomas E Enebo <[email protected]> wrote: >> >> I don't know if this has anything to do with it, but the SQLite engine >> itself is loaded in NestedVM. I would not think that would have a >> large bearing on the JDBC driver itself, but it is something different >> about this particular database. >> > > We have seen even mysql driver instances hanging as well so I dont think it > has anything to do with this specific database. > -vivek. > >> >> -Tom >> >> On Mon, Nov 9, 2009 at 7:25 PM, Vivek Pandey <[email protected]> >> wrote: >> > I am investigating memory leak related to hot deployment of Rails >> > application on GlassFish. One of the hanging references is the JDBC >> > driver, >> > in this case: org.sqlite.JDBC. The class loader is >> > org.jruby.util.JRubyClassLoader. >> > I tried to fix it by trying to do something like this: >> > for (Enumeration e = DriverManager.getDrivers(); >> > e.hasMoreElements();) { >> > Driver driver = (Driver) e.nextElement(); >> > if (driver.getClass().getClassLoader() == >> > getClass().getClassLoader()) { >> > DriverManager.deregisterDriver(driver); >> > } >> > } >> > This does not work because DriverManager.getDrivers() returns only the >> > drivers loaded by this classloader so org.sqlite3.JDBC is not even >> > reported >> > although in the debugger I can see it very well and its loaded by >> > JRubyClassLoader. >> > So the right fix will be in Ruby.tearDown() to do what I am trying to do >> > using JRubyClassLoader loaded class. >> > I have opened a JIRA: http://jira.codehaus.org/browse/JRUBY-4226 >> > -vivek. >> >> >> >> -- >> blog: http://blog.enebo.com twitter: tom_enebo >> mail: [email protected] >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > -- Kristian Meier + Saumya Sharma + Sanuka Meier Vadakkethu House, Edayanmula West PO - 689532, Pathanamthitta District, Kerala, INDIA tel: +91 468 2319577 protect your privacy while searching the net: www.ixquick.com _=_ q(-_-)p '_) (_` /__/ \ _(<_ / )_ (__\_\_|_/__) --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
