Derby
  1. Derby
  2. DERBY-4172

You can open a read-write connection to a database which was originally opened by another thread using the classpath subprotocol

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal

      Description

      The original connection, using the classpath subprotocol, was supposed to open the DATABASE (not the connection) as read-only, according to the Developer's Guide section titled "Database connection examples". However, I am able to write to this database in another connection which opens the database using the default, file-based protocol.

      At a minimum, the documentation is wrong. But the documentation may be trying to impose a consistent, easily described model on the behavior of our subprotocols. It may be that the behavior of our subprotocols cannot be described by a simple set of rules that users can grasp easily.

      To show this problem, I created a database and then moved it into a directory on my classpath (in this case, trunk/classes). Here is a script which shows this behavior:

      connect 'jdbc:derby:classpath:derby10.6' as conn1;

      – fails because a database which is opened on the classpath is supposed to be marked as read-only
      insert into t( a ) values 1;

      connect 'jdbc:derby:trunk/classes/derby10.6' as conn2;

      – this succeeds even though the database is supposed to be read-only
      – according to the Developer's Guide section "Database connection examples"
      insert into t( a ) values 2;

      select * from t;
      delete from t;

        Activity

        Rick Hillegas created issue -
        Rick Hillegas made changes -
        Field Original Value New Value
        Urgency Normal
        Kathey Marsden made changes -
        Labels derby_triage10_5_2
        Gavin made changes -
        Workflow jira [ 12461339 ] Default workflow, editable Closed status [ 12799368 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Rick Hillegas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development