This discussion is archived
1 Reply Latest reply: Nov 12, 2012 3:17 PM by user485536 RSS

Static fields in Java Stored Procedures

929890 Newbie
Currently Being Moderated
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
    user485536 Newbie
    Currently Being Moderated
    In general content of static fields is preserved for life time of session.

    See
    http://docs.oracle.com/cd/E11882_01/java.112/e10588/chone.htm

    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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points