6

IN DB2 V5R4, When you modify the functionality of a DETERMINISTIC UDF It returns the cached response for a while...

There are any way to reset the cached responses?

Thanks in advance.

AngocA
  • 7,655
  • 6
  • 39
  • 55
Pedro Vaquero
  • 89
  • 1
  • 10
  • Reset it how? If it _needs_ to be reset, that would imply that the results aren't deterministic _on the values passed in_ - which is what I would assume **ALL** RDBMSs would base their optimization off of. You may need to make the UDF non-deterministic, or see about splitting up the function into determinisitic and non-deterministic parts. Can you give us the larger context? We may be able to help. – Clockwork-Muse Feb 10 '12 at 21:53
  • Modifiying the funcionality of a Deterministic UDF it returns for a while the answer of the previous behavior. (V5R4 Did't implement ALTER FUNCTION statement, you MUST first DROP and then CREATE again the function...) – Pedro Vaquero Feb 13 '12 at 09:12
  • Ah, I didn't quite get that it'd been modified - I thought you were wanting to reset it during a statement run... I don't know about any specific command - I would have thought that the `DROP` and `CREATE` cleared any cache. IPLing the system would (almost certainly) do it, but be a bit heavy-handed; perhaps check with your IBM rep? – Clockwork-Muse Feb 14 '12 at 21:31
  • I will.... Thanks X-Zero – Pedro Vaquero Feb 15 '12 at 13:41
  • If you solve the problem try to give us a solution. – AngocA Jun 02 '13 at 09:38
  • Flush package cache probably does this. However, there doesn't seem to be public documentation available on the matter. – user918176 Aug 31 '13 at 16:50
  • If you recycle the database (force all connections) then the function has to be re-executed, thus the cache will be reseted. – AngocA Jan 30 '14 at 21:46

2 Answers2

0

To what is it returning the cached response? Is it through a remote connection or a native access? You might try closing and re-opening any remote connection, or ending and restarting any local jobs.

user2338816
  • 2,163
  • 11
  • 11
0

I just had the same problem. Temporarily create the function not deterministic, do your testing. When everything is fine replace the function deterministic.