Re: Different results using JNDI

From: Arndt Brenschede (a..iamos.de)
Date: Fri Apr 11 2003 - 12:10:19 EDT

  • Next message: Eric Schneider: "Re: Different results using JNDI"

    Hi Eric,

    of course I also cannot debug your problem
    remotely, but here are some ideas of what
    effects could possibly cause such strange bugs.

    First think about connection-pooling. This will
    certainly behave different for the build-in datasource
    and that of your container.

    So if there would be "uncommitted changes" for
    whatever reason in some of the pooled connections,
    that would exlain the sort of behaviour you describe.
    (if you are using a transactional database like oracle)

    This sort of bug is my first guess. So for debugging,
    it would be interesting to trace the identity of the
    connections actually used.

    The other source of strangeness could be if
    your conatiners datasource does prepared-statement-caching.
    Could you check that?
    I'm interested if there are any problems related
    to prepared-statement-caching, cause I'm implementing
    that for cayennes data source.

    regards,

    Arndt

    Eric Schneider wrote:
    > Hi,
    >
    > Kind of an odd situation I'm having here. I have an application that
    > has been implemented with cayenne for 6 months now. Recently, we
    > modified the application to use a JNDI datasource. The change was very
    > straightforward. Instead of looking up connection information in the
    > driver file, the factory attribute in the cayenne.xml file was switched
    > to the JNDIDataSourceFactory and the datasource attribute was set to our
    > JNDI name, jdbc/mysource.
    >
    > The behavior I'm seeing is extremely odd, but consistent. Using the
    > datasource, certain queries (not all) return no rows. The call doesn't
    > throw an exception, just simply returns the standard cayenne debug
    > output saying "return 0 rows" as if the table was truncated. A query
    > will work perfectly qualified one way, but fails to return anything if
    > the qualifiers are slightly different (but also correct).
    >
    > If I copy the SQL that cayenne generates and paste it into SQL plus, it
    > returns records. Also, if I switch back to Cayenne's build in
    > connection pool, it works perfectly. For whatever reason, it
    > just behaves differently. :-|
    >
    > Maybe someone that's a little more familiar with the spaghetti innards
    > of cayenne would know why this could be happening?
    >
    > Thanks,
    > Eric

    -- 
    --
    Dr. Arndt Brenschede
    DIAMOS AG
    Innovapark
    Am Limespark 2
    65843 Sulzbach
    

    Tel.: +49 (0) 61 96 - 65 06 - 134 Fax: +49 (0) 61 96 - 65 06 - 100 mobile: +49 (0) 151 151 36 134 mailto:arndt.brensched..iamos.com http://www.diamos.com



    This archive was generated by hypermail 2.0.0 : Fri Apr 11 2003 - 12:03:15 EDT