Re: [JBoss-user] Advice: how to periodically scan a database table
Hi guys, I'm REALLY interested in how to do this too! I know practically nothing about MBeans but would love to know if they are the recommended way of periodically polling a database for changes, or if as you suggested Guy, using a timer service to access an ejb to check the database is a good approach. Opinions please :-) By the way, the new timer service in J2EE 1.4 it seems perfect for doing this type of thing. thanks very much, Brian - Original Message - From: Guy Rouillier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 4:07 AM Subject: Re: [JBoss-user] Advice: how to periodically scan a database table I haven't thought this through completely, but have you researched using a timer to periodically invoke an EJB, thus dispensing with the MBean entirely? - Original Message - From: Demyanovich, Craig - Apogent [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 06, 2003 1:22 PM Subject: [JBoss-user] Advice: how to periodically scan a database table Greetings, We're using JBoss 2.4.10. One of my colleagues has implemented an MBean that spawns a thread to periodically poll a database table for new rows based on criteria that we control. I see two disadvantages: one, when we hot redeploy our EAR, the MBean can no longer communicate with components in it; two, we can't deploy the MBean with our EAR, i.e., we don't have a single distributable package. I would appreciate any advice for solving our problem such that we could have a single distributable package that we can hot deploy as many times as we like. If such a solution is possible only on JBoss 3.x, that's fine, as I've been investigating our migration path to 3.x. Thanks for your time, Craig --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Advice: how to periodically scan a database table
Many thanks to all who replied. I've been very busy, but I have read the responses. If we change our approach to this problem, I'll try to remember to post the results to the list. Regards, Craig --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Advice: how to periodically scan a database table
Hi guys, I'm REALLY interested in how to do this too! I know practically nothing about MBeans but would love to know if they are the recommended way of periodically polling a database for changes, or if as you suggested Guy, using a timer service to access an ejb to check the database is a good approach. We are using JBoss 3.0.4. We built an MBean that exposes a JMX function. Then configure the JBoss Scheduler to periodically call that JMX function. Very simple to do. The jboss docs tell you how to set up the scheduler to call the jmx function. Doing it this way avoids any jboss dependencies in your code base. The only little pain was setting up an abstract mbean class; we didn't want to extend the canned one from jboss for the same reason (vendor specific dependencies). That took under a day's work for one developer. The concrete mbean implementations are very thin. They get a reference to the EJB that does the actual work. The only small problem we have is that the scheduler kicks off before the mbean is ready to take the call causing an error at startup. I have seen posts on how to avoid this -- just haven't taken the time to do it. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Advice: how to periodically scan a database table
With JBoss 3.0.x at least 3.0.5 and up it works. We deploy an app as an EAR containing an MBean. Cheers, Bernhard -Ursprüngliche Nachricht- Von: Demyanovich, Craig - Apogent [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 6. Februar 2003 19:22 An: '[EMAIL PROTECTED]' Betreff: [JBoss-user] Advice: how to periodically scan a database table Greetings, We're using JBoss 2.4.10. One of my colleagues has implemented an MBean that spawns a thread to periodically poll a database table for new rows based on criteria that we control. I see two disadvantages: one, when we hot redeploy our EAR, the MBean can no longer communicate with components in it; two, we can't deploy the MBean with our EAR, i.e., we don't have a single distributable package. I would appreciate any advice for solving our problem such that we could have a single distributable package that we can hot deploy as many times as we like. If such a solution is possible only on JBoss 3.x, that's fine, as I've been investigating our migration path to 3.x. Thanks for your time, Craig --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Advice: how to periodically scan a database table
Title: RE: [JBoss-user] Advice: how to periodically scan a database table You can deploy an MBean in an .ear. We do it by putting a .sar in the ejb .jar inside the .ear - You can also do it another way, I think by putting an application.xml in the .ear that loads the .sar (which has the MBean). JD -Original Message- From: Demyanovich, Craig - Apogent [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 10:22 AM To: '[EMAIL PROTECTED]' Subject: [JBoss-user] Advice: how to periodically scan a database table Greetings, We're using JBoss 2.4.10. One of my colleagues has implemented an MBean that spawns a thread to periodically poll a database table for new rows based on criteria that we control. I see two disadvantages: one, when we hot redeploy our EAR, the MBean can no longer communicate with components in it; two, we can't deploy the MBean with our EAR, i.e., we don't have a single distributable package. I would appreciate any advice for solving our problem such that we could have a single distributable package that we can hot deploy as many times as we like. If such a solution is possible only on JBoss 3.x, that's fine, as I've been investigating our migration path to 3.x. Thanks for your time, Craig --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Advice: how to periodically scan a database table
How are you locating the component (EJB?) from the MBean? When you redeploy EJB's, the MBean may be losing it's reference and still be referencing the old instance of the component. If you can't redeploy the MBean with the EAR, the MBean will have to obtain a new reference via JNDI to the redeployed component before every operation on it. ...when we hot redeploy our EAR, the MBean can no longer communicate with components in it --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Advice: how to periodically scan a database table
My colleague tells me that the home interface is cached in the MBean. Although the home interface has not changed, is the caching the source of the problem? Since the MBean is not in the EAR, we generally shut down JBoss, redeploy the EAR, restart JBoss; the MBean is then reinitialized and can use the components in the EAR. Thanks, Craig -Original Message- From: Tom Coleman [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 2:07 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Advice: how to periodically scan a database table How are you locating the component (EJB?) from the MBean? When you redeploy EJB's, the MBean may be losing it's reference and still be referencing the old instance of the component. If you can't redeploy the MBean with the EAR, the MBean will have to obtain a new reference via JNDI to the redeployed component before every operation on it. ...when we hot redeploy our EAR, the MBean can no longer communicate with components in it --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Advice: how to periodically scan a database table
I haven't thought this through completely, but have you researched using a timer to periodically invoke an EJB, thus dispensing with the MBean entirely? - Original Message - From: Demyanovich, Craig - Apogent [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 06, 2003 1:22 PM Subject: [JBoss-user] Advice: how to periodically scan a database table Greetings, We're using JBoss 2.4.10. One of my colleagues has implemented an MBean that spawns a thread to periodically poll a database table for new rows based on criteria that we control. I see two disadvantages: one, when we hot redeploy our EAR, the MBean can no longer communicate with components in it; two, we can't deploy the MBean with our EAR, i.e., we don't have a single distributable package. I would appreciate any advice for solving our problem such that we could have a single distributable package that we can hot deploy as many times as we like. If such a solution is possible only on JBoss 3.x, that's fine, as I've been investigating our migration path to 3.x. Thanks for your time, Craig --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user