|Problems with package variables and RAC [message #285760]
|Wed, 05 December 2007 08:42
Registered: December 2007
I have been having some problems with some packages i have been playing around with and was hoping someone might be able to help me out.
Basically, we have a package (we'll call it package A) which goes off and calculates a price for a product, currently on an 8i database, which is called by a webpage and returns a price. Package A retrieves the data it needs and does any necessary formatting, and then calls Package B, which actually does the calculations. Package B then passes the price back to package A, which sets up some records on the database and spits out the price to the webpage. Currently this is done by passing a load of parameters between procedures.
I have made some changes to the packages so that in the specification of package A a load of global variables are declared. These are then populated at the beginning of the main procedure in package A and accessed in package B. This all works fine on our development 8i database.
The complication comes in that we are in the process of testing a migration to a 10g based RAC setup with 2 database instances. I decided to test out my code to make sure it worked on the new setup befoore going too much further into development, and lo and behold, it all goes horribly wrong. And i'm at a loss as to what is happening. From what i can tell from tracing out what the packages are doing, the procedures seem to be swapping between the two instances at will, and thus session data is being corrupted as half the processing that is supposed to happen to it within package B is not happening. An example of this is something similar to thus:
if v_var1 > 0 then
Now, i know that v_var1 = 0, so procedure1 is not being called. The first trace of sessionvar_1 is 0, the second is something around 715.25 - yet no changes to the value have happened within the code.
So really i was hoping someone might have come across this sort of thing before, or has any idea what might be going wrong, or whether it's just a case that this way of carrying data within a session will not work in a RAC setup. I have spent ages scouring google and various sites/forums looking for an answer with no luck.