2 Replies Latest reply on Sep 7, 2001 5:44 PM by dabder

    A setMaxRows(0) is missing in PrepareStatementInPool impleme

    dabder

      When calling setMaxRows(n) on a prepareStatement where n > 0, the next new PrepareStatement results are limited to n rows (even if the first one is closed).

      We have to undo the setMaxRows calls by adding on the method PrepareStatementInPool.close() :

      impl.setMaxRows(0)

      May be pathed in StatemnetInPool file too.

        • 1. Re: A setMaxRows(0) is missing in PrepareStatementInPool imp
          davidjencks

          Are you sure this is a good idea? You had to get the prepared statement and call setMaxRows on it, right? so why can't you call setMaxRows(0) when you are done? Is there some reason this doesn't work?

          • 2. Re: A setMaxRows(0) is missing in PrepareStatementInPool imp
            dabder

            I don't agree.

            For instance :

            // BEGIN
            PrepareStatement ps1 = connection.prepareStatement();
            ps1.setMaxRows(13);

            ....

            ps1.close();

            PrepareStatement ps2 = connection.prepareStatement();

            /////////// END

            Without patching the PrepareStatementInPool.close method, ps2 result will be limited to 13 rows. It's an
            amazing thing, isn't it ?

            I don't think that doing a ps1.setMaxRows(0) before close, is a good way .

            When we create a new prepareStatement, the new PS must be independant. This same code works on BEA WL.