db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Gramark <l...@stickybit.se>
Subject Re: Debugging StackOverflowError
Date Thu, 06 Jul 2006 12:23:35 GMT

I came across the same StackOverflowError in my project and it seems as if
the problem relates to the driver registration. If you register the driver
twice, the shutdown process gets stuck in a loop eventually causing a
StackOverflowError. Look at the code below. If the second registration is
removed, the error does not occur.
The workaround is rather simple but I would classify this behavior as a bug.
What do you think? Should I file this i Jira?

/Lars Gr?mark

    public static void main(String[] args)
    {
        try
        {
            //DriverManager.setLogStream(System.out);

            Driver drv =
(Driver)Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
            DriverManager.registerDriver(drv);
            DriverManager.registerDriver(drv);

            String url = "jdbc:derby:/tmp/derby1152180893178;create=true";
            
            DriverManager.getConnection(url);
            DriverManager.getConnection("jdbc:derby:;shutdown=true");
            

        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

-- 
View this message in context: http://www.nabble.com/Debugging-StackOverflowError-tf839276.html#a5198638
Sent from the Apache Derby Developers forum at Nabble.com.


Mime
View raw message