db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trejkaz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6796) Impossible to define new sub-subprotocols
Date Mon, 02 Mar 2015 05:53:04 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342793#comment-14342793

Trejkaz commented on DERBY-6796:

Nope, I can't figure out how to test this in isolation.

If I do the obvious least-effort test (define a new system property, point it to a subclass
of DirStorageFactory), the issue still occurs (in the debugger, I can clearly see it getting
the wrong value), but somehow Derby somehow falls back to the other factory and a database
is still created at the location I specified.

Is there some way to turn off that sort of fallback?

> Impossible to define new sub-subprotocols
> -----------------------------------------
>                 Key: DERBY-6796
>                 URL: https://issues.apache.org/jira/browse/DERBY-6796
>             Project: Derby
>          Issue Type: Bug
>          Components: Miscellaneous
>    Affects Versions:
>            Reporter: Trejkaz
>         Attachments: wrong-prefix-cut.patch
> We discovered this in but I looked at the source in trunk and the issue is still
> To define a new sub-subprotocol (or I guess override an existing one?) by setting a system
property, you are supposed to set "derby.subSubProtocol.myproto" with the name of your storage
factory class as the value.
> Problem is, the way these are loaded strips the wrong prefix off the front of the string.
> {code}
>             if (key.startsWith(Property.MODULE_PREFIX)) {
>                 tag = key.substring(Property.MODULE_PREFIX.length());
>             } else if (key.startsWith(Property.SUB_SUB_PROTOCOL_PREFIX)) {
>                 tag = key.substring(Property.MODULE_PREFIX.length());
>             } else {
>                 continue nextModule;
>             }
> {code}
> So you get "rotocol.myproto" as the protocol you have to use in your connection strings.

This message was sent by Atlassian JIRA

View raw message