Jae wrote:
Hello, here's what I want to do but I'm not sure if it will work
because Im not sure how DB2 works with the JVM.
Heres my setup:
DB2---->UDF Class (lets call it A)----->Static Class (Lets call it B)
I have a class that contains some UDFs. I want these UDFs to call
static methods on class B. Its very important that the static
variables in class B is *NEVER* reset. I understand that on each
statement class A will have a new object instantiated. Will DB2 ever
reset the static data in class B?
DB2 uses a specialized Java class loader to ensure that each connection is
separated from all others. (That's the "isolation" concept in the ACID
properties of transactions.) So upon the first invocation, the JVM creates
the static object of class B _for the current connection_. Another
connection will have another object of class B!
The static objects themselves live as long as the JVM is running. I don't
think DB2 will shut the JVM down, unless DB2 itself is shut down. So the
answer to your question is that the static objects are not destroyed
("reset" is hardly the right term, is it?).
--
Knut Stolze
DB2 Information Integration Development
IBM Germany