db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gus Heck <gus.h...@olin.edu>
Subject Re: Progress on MetaDataManager bug?
Date Tue, 03 Feb 2004 21:03:32 GMT
Yes you tested my workaround code. What doesn't work is:

       MetadataManager mm = MetadataManager.getInstance();
       ConnectionRepository cRepos = mm.connectionRepository();
       JdbcConnectionDescriptor descriptor = cRepos.getDescriptor(new 
PBKey("fdbcon"));

without doing:

        descriptor.setUserName("sa");
        descriptor.setPassWord("");

By contrast when you get a descriptor this way:

    PersistenceBroker broker = 
PersistenceBrokerFactory.defaultPersistenceBroker();
    JdbcConnectionDescriptor descriptor = 
broker.serviceConnectionManager().getConnectionDescriptor();

there is no need to set the username or password. The question is, is 
there a good reason for one way to erase the user name and password and 
the other way retain it.

-Gus

Armin Waibel wrote:

> Hi,
>
>> Cool. Thanks! That works. That just leaves the question of whether 
>> the way I was doing it _should_ work. Both methods yield a 
>> JdbcConnectionDescriptor, but with my method the username and 
>> password have been stripped. Is this a feature that needs 
>> doucmentation or a bug?
>>
>> My way:
>>
>>        MetadataManager mm = MetadataManager.getInstance();
>>        ConnectionRepository cRepos = mm.connectionRepository();
>>        JdbcConnectionDescriptor descriptor = cRepos.getDescriptor(new 
>> PBKey("fdbcon"));
>
>
> I did a test using your code:
>
> public void testCon() throws Exception
>     {
>         JdbcConnectionDescriptor descriptor = 
> MetadataManager.getInstance().connectionRepository().getDescriptor(TestHelper.DEF_KEY);

>
>         descriptor.setUserName("sa");
>         descriptor.setPassWord("");
>         Connection existing;
>         ConnectionFactory cf = 
> ConnectionFactoryFactory.getInstance().createConnectionFactory();
>         existing = cf.lookupConnection(descriptor);
>     }
>
> This test works for me.
>
> regards,
> Armin
>
>>
>>
>> -Gus
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message