hi all,

i'm using the excalibur datasource package to access a IBM DB2 database,
which does not support the default <keep-alive> SELECT 1
i did not find any similar in db2 (and for performace reasons) i removed the 
<keep-alive> config.
now i got errors during startup, which are "bugs" in some of the files.
somebody may commit this to cvs. i used a cvs-checkout a few days ago.
i subscribed to this list today, so i do not know if this is a "known bug" (or a 
feature??)

file org.apache.avalon.excalibur.datasource.JdbcDataSource
method configure( final Configuration configuration ) (from line 146):

            if (oradb)
            {
                keepAlive = "SELECT 1 FROM DUAL";

                if (getLogger().isWarnEnabled())
                {
                    getLogger().warn("The oradb attribute is deprecated, please use 
the" +
                                     "keep-alive element instead.");
                }
            }
            else
            {
                // XXX: let the user set this in config !!
                //keepAlive = "SELECT 1"; <<<<<<<<<<<< always sets default
            }

now keep-alive may be null, but connectionfactory throws exceptions:

file org.apache.avalon.excalibur.datasource.JdbcConnectionFactory
method public JdbcConnectionFactory( final String url,
                                 final String username,
                                 final String password,
                                 final boolean autoCommit,
                                 final String keepAlive,
                                 final String connectionClass) (from line 73)

        this.m_password = password;
        this.m_autoCommit = autoCommit;
        // otherwise new Instance() does not work (NullPointerException during 
Reflection)
        if (keepAlive == null) { <<<<<<<< but i think there is a better way?!
                this.m_keepAlive = "";
        } else {
                this.m_keepAlive = keepAlive;   
        }

after all a small bug in abstract-connection:

file org.apache.avalon.excalibur.datasource.AbstractJdbcConnection
method public AbstractJdbcConnection( final Connection connection, final String 
keepAlive ) (from line 63):

        // subclasses can override initialize()
        this.initialize();

                // not &&
        if (null == keepAlive || "".equals(keepAlive.trim())) <<<<< wrong bool
        {
            m_testStatement = null;
            m_testException = null;
        }
        else
        {

ok, thanx for now. btw: great work with avalon!

Mit freundlichen Gr��en / Best Regards,

Alexander "Stiefel" M�ller
Gesch�ftsf�hrer

stiefelnet e-Solver GmbH
Friedensplatz 4; D-01309 Dresden
www.stiefelnet.de

fon    +49 (0)3 51 - 31 25 41 0
fax    +49 (0)3 51 - 31 25 41 7
mobil  +49 (0)1 71 - 48 10 96 9
e-mail [EMAIL PROTECTED]
BEGIN:VCARD
VERSION:2.1
N:M�ller;Alexander
FN:Alexander M�ller
NICKNAME:Stiefel
ORG:stiefelnet e-Solver GmbH
TITLE:Gesch�ftsf�hrer
TEL;WORK;VOICE:+49 (0351) - 312 54 10
TEL;CELL;VOICE:+49 (0171) - 48 10 96 9
TEL;WORK;FAX:+49 (0351) - 312 54 17
ADR;WORK:;;Friedensplatz 4;Dresden, Sachsen;;01309;Deutschland
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Friedensplatz 4=0D=0ADresden, Sachsen 01309=0D=0ADeutschland
X-WAB-GENDER:2
URL;WORK:http://www.stiefelnet.de
BDAY:20020118
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20010806T210037Z
END:VCARD

Attachment: smime.p7s
Description: application/pkcs7-signature

Reply via email to