I’m currently developing an application which connects to a database using sqlalchemy. The idea consists of having several instances of the application running in different computers using the same database. I want to be able to see changes in the database in all instances of the application once they are commited. I’m currently using sqlalchemy event interface, however it’s not working when I have several concurrent instances of the application. I change something in one of the instances, but there are no signals emitted in the other instances.
I’m currently developing an application which connects to a database using sqlalchemy. The idea
Share
You said it, you are using SQLAlchemy’s event interface, it is not the one of the RDBMS, and SQLAlchemy does not communicate with the other instances connected to that DB.
SQLAlchemy’s event system calls a function in your own process. It’s up to you to make this function send a signal to the rest of them via the network (or however they are connected). As long as SQLAlchemy is concerned, it doesn’t know about the other instances connected to your database.
So, you might want to start another server on the machine with the database running, and make all the other listening to it, and act accordingly.
Hope it helps.