Derby tried to reencrypt DB when other than owner connects
----------------------------------------------------------

                 Key: DERBY-4030
                 URL: https://issues.apache.org/jira/browse/DERBY-4030
             Project: Derby
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 10.4.2.0
         Environment: Linux 2.6.27.7 #3 SMP Sun Nov 30 17:18:23 CET 2008 x86_64 
AMD Turion(tm) 64 X2 Mobile Technology TL-60 GNU/Linux

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)
            Reporter: EDAH-TALLY
             Fix For: 10.4.2.1
         Attachments: DerbyIssue3.java

DB : with requireAuthentication and SQLAuthorization enabled

DB owner connects painlessly

Another user tries to connect : first connection fails with Connection 
Exception 08004 : 
User '<authorizationID>' cannot (re)encrypt database '<databaseName>'. Only the 
database owner can perform this operation.

StackTrace : 
java.sql.SQLNonTransientConnectionException: L'utilisateur 'OTHERUSER' ne peut 
pas (réen)coder la base de données '/tmp/DerbyIssue3'. Seul le propriétaire de 
la base de données est habilité à effectuer cette opération.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.checkIsDBOwner(Unknown 
Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
        at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at DerbyIssue3.connect(DerbyIssue3.java:83)
        at DerbyIssue3.main(DerbyIssue3.java:26)
Caused by: java.sql.SQLException: L'utilisateur 'OTHERUSER' ne peut pas 
(réen)coder la base de données '/tmp/DerbyIssue3'. Seul le propriétaire de la 
base de données est habilité à effectuer cette opération.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
 Source)
        ... 16 more

Second connection in same running JVM succeeds.

The other user seems to work normally afterwards.

Sample program is attached to reproduce the exception.

Don't know if it has already been reported, didn't find a similar one.

Thank you for investigating.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to