Thread: Callbacks for NOTIFY
Hello, is there some developing going on in order to allow applications to register callbacks for the NOTIFY command? If there isn't I will dig through the code and see whether I am able to develop a (more or less functional) patch. Is there a need for that kind of functionality and how are the chances that a patch like this will be included in the official distribution? Kind regards, Johann Uhrmann -- Johann Uhrmann xpecto AG | Lindenstrasse 81 | D-84030 Ergolding Telefon: 0700 xpecto 00 (0700 973286 00) Telefax: 0700 xpecto 10 (0700 973286 10) Internet: http://www.xpecto.com
Johann, I do not know of anyone else working on this, but this has come up a couple of times in the past so I could be mistaken. You might want to check the email archives. I think this functionality would be an interesting addition to the driver. So I encourage you to investigate if you have the interest. Once you get a firm idea of what you want to do, I would suggest sending your ideas/design to this list for feedback. Getting feedback early on and working that feeback into your patch is the best way of insuring that what you build can and will get incorporated. Having said that, I think there are some real challenges in getting this done due to how notifications are handled by the database. Specifically how do you get the notifications to the client without having the client poll the server for new notifications. thanks, --Barry Johann Uhrmann wrote: > Hello, > > is there some developing going on in order to allow > applications to register callbacks for the NOTIFY command? > > If there isn't I will dig through the code and see whether > I am able to develop a (more or less functional) patch. > > Is there a need for that kind of functionality and how are > the chances that a patch like this will be included in > the official distribution? > > Kind regards, > > Johann Uhrmann >
I was wondering, have y'all considered using JMS to broadcast after manipulating the database? Or is the requirement specificallyfor the DB to notify? -----Original Message----- From: Barry Lind <blind@xythos.com> Sent: Aug 28, 2003 1:37 PM To: Johann Uhrmann <johann.uhrmann@xpecto.com> Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Callbacks for NOTIFY Johann, I do not know of anyone else working on this, but this has come up a couple of times in the past so I could be mistaken. You might want to check the email archives. I think this functionality would be an interesting addition to the driver. So I encourage you to investigate if you have the interest. Once you get a firm idea of what you want to do, I would suggest sending your ideas/design to this list for feedback. Getting feedback early on and working that feeback into your patch is the best way of insuring that what you build can and will get incorporated. Having said that, I think there are some real challenges in getting this done due to how notifications are handled by the database. Specifically how do you get the notifications to the client without having the client poll the server for new notifications. thanks, --Barry Johann Uhrmann wrote: > Hello, > > is there some developing going on in order to allow > applications to register callbacks for the NOTIFY command? > > If there isn't I will dig through the code and see whether > I am able to develop a (more or less functional) patch. > > Is there a need for that kind of functionality and how are > the chances that a patch like this will be included in > the official distribution? > > Kind regards, > > Johann Uhrmann > ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings
Scot P. Floess wrote: > I was wondering, have y'all considered using JMS to broadcast after manipulating the database? Or is the requirement specificallyfor the DB to notify? The requirement is that notify-commands cause a callback method to be called. JMS might be a solution for some cases, but not all Java applications run in an environment with JMS. In addition, JMS is limited to Java whereas notify can be executed by any DB client or even by the database itself (trigger). Let me provide an example: Imagine a database with a table for user privileges. Clients might want to cache that table in order to hold the number of concurrent connections low. However, it is mandatory that clients are informed about changes in that table. A trigger that executes a notify on inserts/updates/deletes on that table would inform the clients about the change. (No matter who did the change - it could even be through the psql interface.) JMS and an application server architecture are definitely the solution to choose for a big number of applications but there are also many scenarios where a "notify-callback" would be handy. Kind regards, Johann Uhrmann P.S.: Using the "notify-callback" functionality in a J2EE environment would not be allowed because it is similar to the creation of new threads which is definitely not allowed for Enterprise Beans. But that does not mean that the driver itself could not be used by an j2ee server - it is merely that callback registration which would be off limits. -- Johann Uhrmann xpecto AG | Lindenstrasse 81 | D-84030 Ergolding Telefon: 0700 xpecto 00 (0700 973286 00) Telefax: 0700 xpecto 10 (0700 973286 10) Internet: http://www.xpecto.com