That is an interesting idea. I was acutally thinking about adding a feature where the database can inform JBoss that a row has changed, which would cause a cache flush on that entity.
I never thought that someone would want the same notifications from JBoss. I will defiantely put this in the requirements for the new JBoss cache.
In the mean time, you could add JMX notifications to the JDBCStoreEntityCommand. If you do go this route, can you post a patch at sf; I would really like to get this in.
Thanks for you reply.
I don't have much experience with JBoss. I am willing to make these changes to JDBCStoreEntityCommand but i will need some guidance.
JDBCStoreEntityCommand is not a MBean so how can i post notifications?
Another issue is that i have to track when the transaction completes and then send a javagroups message to the distributed cache.
Any ideas about that?
I am very interested in this feature where the database informs Jboss that a row has changed. Can you tell me where I can find more info on this and when this feature will be available?
Thank's, great job!
EntityContainer is an MBean and you can get a handle to the container from JDBCStoreManager.
As for wanting transaction complete event, that is very simple, see the ApplicationTxDataSynchronization class in JDBCStoreManager.
> I am very interested in this feature where the
> database informs Jboss that a row has changed. Can
> you tell me where I can find more info on this and
> when this feature will be available?
It is planed for the new cache in JBoss 4.0, but you can do it today. From what I understand, all you need is for your database to send a message to JBoss when a row changes (in an update triger). It doesn't matter how the message gets to the server (a simple servlet will work). You catch the message and then invoke the flush operation on the EntityInstanceCache with JMX.
There are some companies using this strategy in production today.
Thank you for your suggestions.
I made an implementation of what you suggested. I made some tests and seemed to work.
there are 3 files changed.
Can you generate a diff and post it as a patch on soruce forge?
Sorry but i don't know how to do that.
Patches can be submitted at
You will need to get a login at sourceforge to post files, but I get the feeling this won't be the last time you submit a patch to us.
To generate a patch execute the following command from the org/jboss/ejb directory:
cvs diff -u > patch.txt
This assumes you got the source from cvs. If you did not, then just post the three files and I'll figure out the difference.
Thanks for the good work.
i got the source file from sourceforge cause my company doen't allow me cvs access.
So you will have to make tha patch for me.
Tha files are attached with a previous post i made in this topic.
Thanks in advance!
I am sending the files...
Create a new patch at http://sourceforge.net/tracker/?group_id=22866&atid=376687
After your second patch you get RW for the JBoss source. Yes, I can get the files from your post here, but the point is to get you used to using the regular tools. This is realy good work; now take the last step and create an official patch request at sourceforge.
If you decide not to create a patch, that is fine. We'll still patch the code. Actally, I think Sacha is going to apply this patch, because he is working on a distributed cache.