Andremoniy
Andremoniy

Reputation: 34900

Running DB2 java stored procedures in single process

It seems, that DB2 creates new process for each connection when running java stored procedures in it (for example, procedures, which are called from trigger on some table update event). The question is: is any way for running all java stored procedures in single process, so we could share static values between them?

Upvotes: 0

Views: 489

Answers (2)

Andremoniy
Andremoniy

Reputation: 34900

Unfortunately, I have to give a negative answer to my own question. According to this paper: Static and non-final variables in a Java routine exactly what I'd like to do is impossible.

Upvotes: 1

user918176
user918176

Reputation: 1800

DB2 will force multi-process model execution of your stored procedures.

I would suggest you to just send your data to a message queue, and have an application listening to that queue handle the data and do the logging. Take a look at for example RabbitMQ, Apache ActiveMQ, or ZeroMQ.

This would be probably trivial to implement, but it requires usually that you have a daemon with your application logic running. This is true unless you configure the message queue product to spawn your application logic automatically - which is usually possible with message queue products but requires a bit more configuration.

Upvotes: 1

Related Questions