Derby
  1. Derby
  2. DERBY-4907

EmbeddedXADataSource with ;create=true attribute set in setDatabaseName fails with java.sql.SQLException: Database not available

    Details

    • Urgency:
      Low
    • Issue & fix info:
      Newcomer, Repro attached, Workaround attached

      Description

      Setting the ;create=true attribute in setDatabaseName with EmbededXADataSource and EmbeddedXADataSource40 fails with
      $ java TestDerbyCreate
      Exception in thread "main" java.sql.SQLException: Database not available
      at org.apache.derby.jdbc.EmbeddedXADataSource.setupResourceAdapter(Embe
      dedXADataSource.java:175)
      at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConnection(EmbeddedX
      DataSource.java:101)
      at TestDerbyCreate.main(TestDerbyCreate.java:18)

      using the create attributie in databaseName works fine with EmbeddedDataSource.

      Using setCreateDatabase("create") with EmbeddedXADataSource is a good work around and I think generally preferable.

      import java.sql.*;
      import javax.sql.*;

      public class TestDerbyCreate
      {
      public static void main(String[] args) throws Throwable
      {
      org.apache.derby.jdbc.EmbeddedXADataSource ds =
      new
      org.apache.derby.jdbc.EmbeddedXADataSource();

      ds.setDatabaseName("TestDB;create=true");
      ds.setUser("dbuser1");
      ds.setPassword("dbpwd1");

      PooledConnection pooledConn = ds.getXAConnection();
      Connection conn = pooledConn.getConnection();

      System.out.println("Database product: " +
      conn.getMetaData().getDatabaseProductName());
      System.out.println("Database version: " +
      conn.getMetaData().getDatabaseProductVersion());
      System.out.println("Driver name: " +
      conn.getMetaData().getDriverName());
      System.out.println("Driver version: " +
      conn.getMetaData().getDriverVersion());
      System.out.println("JDBC driver major ve

      1. derby4907.txt
        2 kB
        Siddharth Srivastava
      2. derby4907.diff
        7 kB
        Siddharth Srivastava
      3. derby4907.diff
        7 kB
        Siddharth Srivastava
      4. derby4907.diff
        5 kB
        Siddharth Srivastava
      5. derby4907.diff
        6 kB
        Siddharth Srivastava
      6. derby4907_with_contains_fix.diff
        6 kB
        Dave Brosius
      7. derby4907_final.diff
        5 kB
        Siddharth Srivastava

        Issue Links

          Activity

          Kathey Marsden created issue -
          Siddharth Srivastava made changes -
          Field Original Value New Value
          Assignee Siddharth Srivastava [ siddharthsrivastava ]
          Siddharth Srivastava made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Siddharth Srivastava made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Siddharth Srivastava made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Siddharth Srivastava made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Siddharth Srivastava made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Siddharth Srivastava made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Siddharth Srivastava made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Siddharth Srivastava made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Siddharth Srivastava made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.txt [ 12470159 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.txt [ 12470159 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.txt [ 12470175 ]
          Siddharth Srivastava made changes -
          Attachment derby4907_final.diff [ 12470790 ]
          Rick Hillegas made changes -
          Labels derby_triage10_8
          Rick Hillegas made changes -
          Urgency Low
          Siddharth Srivastava made changes -
          Attachment derby4907.diff [ 12471177 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.diff [ 12471178 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.diff [ 12471475 ]
          Siddharth Srivastava made changes -
          Attachment derby4907.diff [ 12471819 ]
          Tiago R. Espinha made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Dave Brosius made changes -
          Attachment derby4907_with_contains_fix.diff [ 12472686 ]
          Tiago R. Espinha made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Siddharth Srivastava made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Siddharth Srivastava made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Siddharth Srivastava made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 10.6.2.1 [ 12315343 ]
          Fix Version/s 10.5.3.0 [ 12314117 ]
          Fix Version/s 10.4.2.0 [ 12313345 ]
          Fix Version/s 10.3.3.0 [ 12313142 ]
          Fix Version/s 10.2.2.0 [ 12312027 ]
          Fix Version/s 10.1.3.1 [ 12311953 ]
          Resolution Fixed [ 1 ]
          Siddharth Srivastava made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Siddharth Srivastava made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Siddharth Srivastava made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 10.8.0.0 [ 12315561 ]
          Fix Version/s 10.1.3.1 [ 12311953 ]
          Fix Version/s 10.2.2.0 [ 12312027 ]
          Fix Version/s 10.3.3.0 [ 12313142 ]
          Fix Version/s 10.4.2.0 [ 12313345 ]
          Fix Version/s 10.5.3.0 [ 12314117 ]
          Fix Version/s 10.6.2.1 [ 12315343 ]
          Resolution Fixed [ 1 ]
          Siddharth Srivastava made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Kathey Marsden made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Tiago R. Espinha made changes -
          Link This issue blocks DERBY-5091 [ DERBY-5091 ]
          Kathey Marsden made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Fix Version/s 10.7.1.3 [ 12315902 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.8.1.0 [ 12315561 ]
          Rick Hillegas made changes -
          Fix Version/s 10.8.1.2 [ 12316362 ]
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Siddharth Srivastava made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Link This issue blocks DERBY-5091 [ DERBY-5091 ]
          Gavin made changes -
          Link This issue is depended upon by DERBY-5091 [ DERBY-5091 ]
          Gavin made changes -
          Workflow jira [ 12527277 ] Default workflow, editable Closed status [ 12802454 ]

            People

            • Assignee:
              Siddharth Srivastava
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development