Peter Bacsko created OOZIE-3296:
-----------------------------------

             Summary: Make sure that Derby is shut down after each testcase
                 Key: OOZIE-3296
                 URL: https://issues.apache.org/jira/browse/OOZIE-3296
             Project: Oozie
          Issue Type: Sub-task
            Reporter: Peter Bacsko
            Assignee: Peter Bacsko


Currently we use in-memory HSQLDB for Oozie tests. However, if we switch to 
Derby, we can't run all tests in a single suite because we'll get "Too many 
open files" error.

This happens before every testcase creates its own Derby instance and the 
previous one is not shut down properly. A single Derby instance opens around 
40-50 files, so the number of open files keep accumulating. 

The following code ensures that Derby is closed after each test:

{noformat}
        final String oozieTestDB = System.getProperty("oozie.test.db", "derby");
        
        if (oozieTestDB.equalsIgnoreCase("derby")) {
            try {
                String jdbcUrl = "jdbc:derby:" + testCaseDir + 
"/oozie-derby;shutdown=true";
                java.sql.Connection conn = DriverManager.getConnection(jdbcUrl);
                conn.close();
            } catch (Exception e) {
                log.info(e);
            }
        }
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to