You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Arthur Brown <ar...@gmx.net> on 2005/02/23 09:18:05 UTC

Re: Bug in JNDIConnectionSource

Hi James,

no, I'm trying to use it with Oracle.
However it cannot work with any dialect, because as I described,
it has a bug.

The dialect attribute is set in base class:
ConnectionSourceSkeleton

and the getter in the derived class JNDIConnectionSource
getSQLDialectCode() is returning the attribute from the class
JNDIConnectionSource
where the dialect attribute is initialized with UNKKNOWN and has that value
forever.

To fix, simple comment this code in 

/**
* int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
* public int getSQLDialectCode() {
*    return dialectCode;
*  }
**/

in JNDIConnectionSource 
and everything is fine.

Thanks 
Arthur Brown

> Are you adding a new Dialect?  If yes, then you probably need to
> change at lest a bit of log4j code to know about that new dialect.
> 
> -- 
> James Stauffer
> http://www.geocities.com/stauffer_james/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

>>Hi,
>>
>>I have fund a small problem with
>>JNDIConnectionSource.
>>
>>It overwrite the attribute and getter for
>>
>> int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
>> public int getSQLDialectCode() {
>>    return dialectCode;
>>  }
>>
>>from it's parent class
>>ConnectionSourceSkeleton.
>>
>>However, the function
>>discoverConnnectionProperties()
>>that called to discover the SQL dialect 
>>is located in the parent class, where the attribute is set.
>>
>>Evidently, the getter in JNDIConnectionSource is always returning
>>UNKNOWN_DIALECT.
>>
>>Can somebody with write permission correct this please?
>>
>>Thanks
>>Arthur Brown


-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by Arthur Brown <ar...@gmx.net>.
James,

thank you for your help.
I issued the bug #33827.

Regards
Arthur Brown

> I don't see how it could work.

> Arthur Brown <ar...@gmx.net> wrote:
> > do you agree with me, that without doing anything, i. e.
> > change the code, derive a new class from JNDIConnectionSource
> > and redeclare dialectCode (what for?)
> > it cannot work?
> >
> 
> > What is the regular way to introduce a new bug ?
> http://logging.apache.org/site/bugreport.html
> 
> 
> -- 
> James Stauffer
> http://www.geocities.com/stauffer_james/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by James Stauffer <st...@gmail.com>.
Arthur Brown <ar...@gmx.net> wrote:
> do you agree with me, that without doing anything, i. e.
> change the code, derive a new class from JNDIConnectionSource
> and redeclare dialectCode (what for?)
> it cannot work?
I don't see how it could work.

> What is the regular way to introduce a new bug ?
http://logging.apache.org/site/bugreport.html


-- 
James Stauffer
http://www.geocities.com/stauffer_james/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by Arthur Brown <ar...@gmx.net>.
James,

do you agree with me, that without doing anything, i. e.
change the code, derive a new class from JNDIConnectionSource
and redeclare dialectCode (what for?) 
it cannot work?

What is the regular way to introduce a new bug ?

Regards
Arthur Brown

> JNDIConnectionSource.activateOptions calls
> ConnectionSourceSkeleton.discoverConnnectionProperties which sets
> dialectCode but JNDIConnectionSource redeclares dialectCode from what
> is declared in the super class ConnectionSourceSkeleton.
> 
> Developers, is it supposed to redeclare dialectCode?
> 
> On Thu, 24 Feb 2005 10:14:17 +0100 (MET), Arthur Brown
> <ar...@gmx.net> wrote:
> > 
> > I do not adding anything new, I just try to use the class with
> > Oracle 9, and it doesn't work.
> > 
> > I'm getting the error: Unknown SQLDialect.
> > 
> > After I've debugged it, I figured out, what I've described:
> > 
> > the class
> > JNDIConnectionSource
> > returns all the time the own instance of SQLDialect attribute
> > (UKNOWN)
> > , whereas
> > the base class function
> > ConnectionSourceSkeleton::discoverConnnectionProperties
> > discover correct the Oracle Dialect but assign it to its own (!)
> > instance.
> > 
> > To explain it. I will try to make a schema, after the function
> > discoverConnnectionProperties has been called:
> > 
> > Instance JNDIConnectionSource
> >     dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> >     Base Class:
> >         ConnectionSourceSkeleton
> >         dialectCode = ConnectionSource.Oracle;
> > 
> > that's the situation.
> > the function overwite the base class getter function:
> > 
> > JNDIConnectionSource::getSQLDialectCode()
> > returns JNDIConnectionSource::dialectCode (always UNKNOWN)
> > 
> > whereas the correct value in
> > ConnectionSourceSkeleton::dialectCode
> > is never seen.
> > 
> > To fix it, just remove the own attribute and the own
> > getter function for dialectCode in
> > JNDIConnectionSource class.
> > 
> > In this case the base class value (the correct one) is returned, and all
> is
> > fine.
> > 
> > Regards,
> > Arthur Brown
> > 
> > > Are you trying to make a new OracleDialet?
> > > What is the bug in the current class?  I guess I don't quite
> > > understand your problem and how you are trying to fix it.
> > >
> > > On Wed, 23 Feb 2005 09:18:05 +0100 (MET), Arthur Brown
> > > <ar...@gmx.net> wrote:
> > > > Hi James,
> > > >
> > > > no, I'm trying to use it with Oracle.
> > > > However it cannot work with any dialect, because as I described,
> > > > it has a bug.
> > > >
> > > > The dialect attribute is set in base class:
> > > > ConnectionSourceSkeleton
> > > >
> > > > and the getter in the derived class JNDIConnectionSource
> > > > getSQLDialectCode() is returning the attribute from the class
> > > > JNDIConnectionSource
> > > > where the dialect attribute is initialized with UNKKNOWN and has
> that
> > > value
> > > > forever.
> > > >
> > > > To fix, simple comment this code in
> > > >
> > > > /**
> > > > * int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > > > * public int getSQLDialectCode() {
> > > > *    return dialectCode;
> > > > *  }
> > > > **/
> > > >
> > > > in JNDIConnectionSource
> > > > and everything is fine.
> > > >
> > > > Thanks
> > > > Arthur Brown
> > > >
> > > > > Are you adding a new Dialect?  If yes, then you probably need to
> > > > > change at lest a bit of log4j code to know about that new dialect.
> > > > >
> > > > > --
> > > > > James Stauffer
> > > > > http://www.geocities.com/stauffer_james/
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> > > > >
> > > >
> > > > >>Hi,
> > > > >>
> > > > >>I have fund a small problem with
> > > > >>JNDIConnectionSource.
> > > > >>
> > > > >>It overwrite the attribute and getter for
> > > > >>
> > > > >> int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > > > >> public int getSQLDialectCode() {
> > > > >>    return dialectCode;
> > > > >>  }
> > > > >>
> > > > >>from it's parent class
> > > > >>ConnectionSourceSkeleton.
> > > > >>
> > > > >>However, the function
> > > > >>discoverConnnectionProperties()
> > > > >>that called to discover the SQL dialect
> > > > >>is located in the parent class, where the attribute is set.
> > > > >>
> > > > >>Evidently, the getter in JNDIConnectionSource is always returning
> > > > >>UNKNOWN_DIALECT.
> > > > >>
> > > > >>Can somebody with write permission correct this please?
> > > > >>
> > > > >>Thanks
> > > > >>Arthur Brown
> > > >
> > > > --
> > > > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > > > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > http://www.geocities.com/stauffer_james/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > 
> > --
> > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> > 
> 
> 
> -- 
> James Stauffer
> http://www.geocities.com/stauffer_james/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by James Stauffer <st...@gmail.com>.
JNDIConnectionSource.activateOptions calls
ConnectionSourceSkeleton.discoverConnnectionProperties which sets
dialectCode but JNDIConnectionSource redeclares dialectCode from what
is declared in the super class ConnectionSourceSkeleton.

Developers, is it supposed to redeclare dialectCode?

On Thu, 24 Feb 2005 10:14:17 +0100 (MET), Arthur Brown
<ar...@gmx.net> wrote:
> 
> I do not adding anything new, I just try to use the class with
> Oracle 9, and it doesn't work.
> 
> I'm getting the error: Unknown SQLDialect.
> 
> After I've debugged it, I figured out, what I've described:
> 
> the class
> JNDIConnectionSource
> returns all the time the own instance of SQLDialect attribute
> (UKNOWN)
> , whereas
> the base class function
> ConnectionSourceSkeleton::discoverConnnectionProperties
> discover correct the Oracle Dialect but assign it to its own (!)
> instance.
> 
> To explain it. I will try to make a schema, after the function
> discoverConnnectionProperties has been called:
> 
> Instance JNDIConnectionSource
>     dialectCode = ConnectionSource.UNKNOWN_DIALECT;
>     Base Class:
>         ConnectionSourceSkeleton
>         dialectCode = ConnectionSource.Oracle;
> 
> that's the situation.
> the function overwite the base class getter function:
> 
> JNDIConnectionSource::getSQLDialectCode()
> returns JNDIConnectionSource::dialectCode (always UNKNOWN)
> 
> whereas the correct value in
> ConnectionSourceSkeleton::dialectCode
> is never seen.
> 
> To fix it, just remove the own attribute and the own
> getter function for dialectCode in
> JNDIConnectionSource class.
> 
> In this case the base class value (the correct one) is returned, and all is
> fine.
> 
> Regards,
> Arthur Brown
> 
> > Are you trying to make a new OracleDialet?
> > What is the bug in the current class?  I guess I don't quite
> > understand your problem and how you are trying to fix it.
> >
> > On Wed, 23 Feb 2005 09:18:05 +0100 (MET), Arthur Brown
> > <ar...@gmx.net> wrote:
> > > Hi James,
> > >
> > > no, I'm trying to use it with Oracle.
> > > However it cannot work with any dialect, because as I described,
> > > it has a bug.
> > >
> > > The dialect attribute is set in base class:
> > > ConnectionSourceSkeleton
> > >
> > > and the getter in the derived class JNDIConnectionSource
> > > getSQLDialectCode() is returning the attribute from the class
> > > JNDIConnectionSource
> > > where the dialect attribute is initialized with UNKKNOWN and has that
> > value
> > > forever.
> > >
> > > To fix, simple comment this code in
> > >
> > > /**
> > > * int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > > * public int getSQLDialectCode() {
> > > *    return dialectCode;
> > > *  }
> > > **/
> > >
> > > in JNDIConnectionSource
> > > and everything is fine.
> > >
> > > Thanks
> > > Arthur Brown
> > >
> > > > Are you adding a new Dialect?  If yes, then you probably need to
> > > > change at lest a bit of log4j code to know about that new dialect.
> > > >
> > > > --
> > > > James Stauffer
> > > > http://www.geocities.com/stauffer_james/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > >
> > > >>Hi,
> > > >>
> > > >>I have fund a small problem with
> > > >>JNDIConnectionSource.
> > > >>
> > > >>It overwrite the attribute and getter for
> > > >>
> > > >> int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > > >> public int getSQLDialectCode() {
> > > >>    return dialectCode;
> > > >>  }
> > > >>
> > > >>from it's parent class
> > > >>ConnectionSourceSkeleton.
> > > >>
> > > >>However, the function
> > > >>discoverConnnectionProperties()
> > > >>that called to discover the SQL dialect
> > > >>is located in the parent class, where the attribute is set.
> > > >>
> > > >>Evidently, the getter in JNDIConnectionSource is always returning
> > > >>UNKNOWN_DIALECT.
> > > >>
> > > >>Can somebody with write permission correct this please?
> > > >>
> > > >>Thanks
> > > >>Arthur Brown
> > >
> > > --
> > > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> > >
> >
> >
> > --
> > James Stauffer
> > http://www.geocities.com/stauffer_james/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> 
> --
> Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> 


-- 
James Stauffer
http://www.geocities.com/stauffer_james/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by Arthur Brown <ar...@gmx.net>.
I do not adding anything new, I just try to use the class with
Oracle 9, and it doesn't work.

I'm getting the error: Unknown SQLDialect.

After I've debugged it, I figured out, what I've described:

the class 
JNDIConnectionSource
returns all the time the own instance of SQLDialect attribute
(UKNOWN)
, whereas
the base class function
ConnectionSourceSkeleton::discoverConnnectionProperties
discover correct the Oracle Dialect but assign it to its own (!)
instance.

To explain it. I will try to make a schema, after the function
discoverConnnectionProperties has been called:

Instance JNDIConnectionSource
    dialectCode = ConnectionSource.UNKNOWN_DIALECT;
    Base Class:
        ConnectionSourceSkeleton
        dialectCode = ConnectionSource.Oracle;

that's the situation.
the function overwite the base class getter function:

JNDIConnectionSource::getSQLDialectCode()
returns JNDIConnectionSource::dialectCode (always UNKNOWN)

whereas the correct value in
ConnectionSourceSkeleton::dialectCode
is never seen.

To fix it, just remove the own attribute and the own
getter function for dialectCode in 
JNDIConnectionSource class.

In this case the base class value (the correct one) is returned, and all is
fine.

Regards,
Arthur Brown

> Are you trying to make a new OracleDialet?
> What is the bug in the current class?  I guess I don't quite
> understand your problem and how you are trying to fix it.
> 
> On Wed, 23 Feb 2005 09:18:05 +0100 (MET), Arthur Brown
> <ar...@gmx.net> wrote:
> > Hi James,
> > 
> > no, I'm trying to use it with Oracle.
> > However it cannot work with any dialect, because as I described,
> > it has a bug.
> > 
> > The dialect attribute is set in base class:
> > ConnectionSourceSkeleton
> > 
> > and the getter in the derived class JNDIConnectionSource
> > getSQLDialectCode() is returning the attribute from the class
> > JNDIConnectionSource
> > where the dialect attribute is initialized with UNKKNOWN and has that
> value
> > forever.
> > 
> > To fix, simple comment this code in
> > 
> > /**
> > * int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > * public int getSQLDialectCode() {
> > *    return dialectCode;
> > *  }
> > **/
> > 
> > in JNDIConnectionSource
> > and everything is fine.
> > 
> > Thanks
> > Arthur Brown
> > 
> > > Are you adding a new Dialect?  If yes, then you probably need to
> > > change at lest a bit of log4j code to know about that new dialect.
> > >
> > > --
> > > James Stauffer
> > > http://www.geocities.com/stauffer_james/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > 
> > >>Hi,
> > >>
> > >>I have fund a small problem with
> > >>JNDIConnectionSource.
> > >>
> > >>It overwrite the attribute and getter for
> > >>
> > >> int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> > >> public int getSQLDialectCode() {
> > >>    return dialectCode;
> > >>  }
> > >>
> > >>from it's parent class
> > >>ConnectionSourceSkeleton.
> > >>
> > >>However, the function
> > >>discoverConnnectionProperties()
> > >>that called to discover the SQL dialect
> > >>is located in the parent class, where the attribute is set.
> > >>
> > >>Evidently, the getter in JNDIConnectionSource is always returning
> > >>UNKNOWN_DIALECT.
> > >>
> > >>Can somebody with write permission correct this please?
> > >>
> > >>Thanks
> > >>Arthur Brown
> > 
> > --
> > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> > 
> 
> 
> -- 
> James Stauffer
> http://www.geocities.com/stauffer_james/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Bug in JNDIConnectionSource

Posted by James Stauffer <st...@gmail.com>.
Are you trying to make a new OracleDialet?
What is the bug in the current class?  I guess I don't quite
understand your problem and how you are trying to fix it.

On Wed, 23 Feb 2005 09:18:05 +0100 (MET), Arthur Brown
<ar...@gmx.net> wrote:
> Hi James,
> 
> no, I'm trying to use it with Oracle.
> However it cannot work with any dialect, because as I described,
> it has a bug.
> 
> The dialect attribute is set in base class:
> ConnectionSourceSkeleton
> 
> and the getter in the derived class JNDIConnectionSource
> getSQLDialectCode() is returning the attribute from the class
> JNDIConnectionSource
> where the dialect attribute is initialized with UNKKNOWN and has that value
> forever.
> 
> To fix, simple comment this code in
> 
> /**
> * int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> * public int getSQLDialectCode() {
> *    return dialectCode;
> *  }
> **/
> 
> in JNDIConnectionSource
> and everything is fine.
> 
> Thanks
> Arthur Brown
> 
> > Are you adding a new Dialect?  If yes, then you probably need to
> > change at lest a bit of log4j code to know about that new dialect.
> >
> > --
> > James Stauffer
> > http://www.geocities.com/stauffer_james/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> 
> >>Hi,
> >>
> >>I have fund a small problem with
> >>JNDIConnectionSource.
> >>
> >>It overwrite the attribute and getter for
> >>
> >> int dialectCode = ConnectionSource.UNKNOWN_DIALECT;
> >> public int getSQLDialectCode() {
> >>    return dialectCode;
> >>  }
> >>
> >>from it's parent class
> >>ConnectionSourceSkeleton.
> >>
> >>However, the function
> >>discoverConnnectionProperties()
> >>that called to discover the SQL dialect
> >>is located in the parent class, where the attribute is set.
> >>
> >>Evidently, the getter in JNDIConnectionSource is always returning
> >>UNKNOWN_DIALECT.
> >>
> >>Can somebody with write permission correct this please?
> >>
> >>Thanks
> >>Arthur Brown
> 
> --
> Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> 


-- 
James Stauffer
http://www.geocities.com/stauffer_james/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org