1 Reply Latest reply on Nov 12, 2012 11:17 PM by LindseyInIT

    Static fields in Java Stored Procedures

      I have a Java Stored Procedure which is intended to return BLOBs (some of them are realy large).
      I wonder if it's possible to cache some of them in static fields so that the call returns very quickly if a particular BLOB was loaded already once.

      I tried to assign such a BLOB to a static field and when I run a junit test twice in a loop it works well (first call 379,819ms second call 359ms) but when I start the test again the first call lasts as long as if the BLOB was never called before (~370,000ms).

      What am I doing wrong?
        • 1. Re: Static fields in Java Stored Procedures
          In general content of static fields is preserved for life time of session.


          It is an expensive, performance-wise memory. It primarily exists for the length of a session. All static fields and any objects that exist beyond the lifetime of a call exist here.

          Edited by: LindseyInIT on Nov 13, 2012 12:16 AM