6 Replies Latest reply on Sep 14, 2004 6:47 AM by restrepo

    PreparedStatementCache

    cherold

      Hi

      Does anybody know if there is a runnning preparedStatementCache in Jboss 3.2.x ?
      I use JBoss 3.2.3 with JDK 1.4.2 and DB2 8.1 in Linux.
      I saw there is a property for the Datasource:
      <prepared-statement-cache-size>100</prepared-statement-cache-size>
      but setting this (with different values) didn't change anything.
      On the DB side, it doesn't seem to cache client request for Prepare.

      What I understood is, when caching is enabled the prepare call can be cacheched in the client Pool to avoid a network call (well the DB also caches the prepare internal to avoid recalculating thing each call).

      When enabling the Trace for jboss... resource I couldn't see any hints about caching.

      In the JMX-Console the "JBoss LocalTransaction JDBC Wrapper" has an attribute "PreparedStatementCacheSize" with value null.

      So how does it work , does it work and how to configure?

      I could't find any documentation about it (only in the JCA docs the parameter).

      Thanks

        • 1. Re: PreparedStatementCache
          rafcio

          I think the parameter prepared-statement-cache-size is per transaction. But I'm not sure.


          Regards,
          Rafal

          • 2. Re: PreparedStatementCache
            cherold

            Hi
            what do you meen hen you say " per transaction".
            I use an JDBC DataSource. Transaktions are Handled by DB2 Database.
            I do not use CMP or User Transacton in JBoss.
            So my Conncetion Pool just Pools Connections for my Application.
            Each Connection is used only by my custom Classes (called from SLSB).

            I'm using direkt JDBC API calls. As far as I understood, there are no transaktion performed in JBoss.

            So am I wrong ?

            thanks for help (also some further help :-) )

            Christian

            • 3. Re: PreparedStatementCache
              pants

              We are seeing the same behaviour, setting the prepared-statement-cache-size doesn't seem to have any effect. Is there another setting that needs to be set apart from just the datasource descriptor?

              • 4. Re: PreparedStatementCache
                cherold

                Hi all
                Hi Dear JBoss Cracks !

                Would be nice to get an answer to my question (thanks "pants" and Rafal).
                Isn't there any JBoss Develeper who can answer this little question?
                Why can't I see any Difference when declaring a PreparedStatement Cache in the DataSource config ?

                well thanks a lot .. I will wait some more months :-)

                regards
                Christian

                • 5. Re: PreparedStatementCache
                  pants

                  Found answer, if you call prepareStatement with any arguments other than just the sql then caching doesn't work.

                  • 6. Re: PreparedStatementCache
                    restrepo

                    Hi,

                    What is not yet clear for me is why in the JMX-Console the "JBoss LocalTransaction JDBC Wrapper"the attribute "PreparedStatementCacheSize"has the value null.

                    Is it a JBoss bug? I'am working with JBoss 3.2.5

                    Any help will be really apreciated,

                    Fabio.