We are currently using axon framework alongside with spring boog and hikaricp as data source pooling system. We are facing pool exhausting issues from time to time and we have a theory, the scenario is as follows:
- To update our read models we use the command bus to send UpdateReadModelEntityCommand.
- As the command bus starts a transaction using the primary transaction manager (the write one) it acquires a connection from the write pool
- On the handler, we open an inner transaction using a connection from the read pool, thus blocking the outer one.
This seems to exhaust the pools under some conditions. The question is: should we stop using the command bus to update our read models? Is appropiate to have two buses( one for write and one for read? What can be the rigth approach for projecting the read model? Use commands or just use plain services?
Thanks in advance