Charles, Do you know if listener state events (afterBegin, afterCommit, ...) are going to be invoked in managed environment?
Thank you, Max. -----Original Message----- From: Charles Anthony [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 9:12 AM To: 'OJB Users List' Cc: [EMAIL PROTECTED] Subject: RE: OJB Listener :: Best practise Here's a quick off the cuff list of steps for listeners that work for both ODMG & PB, based on what we do here. a) Create your own persistence broker factory, extending PersistenceBrokerFactoryDefaultImpl b) Override createNewBrokerInstance(PBKey key) and add your listener(s) http://db.apache.org/ojb/api/org/apache/ojb/broker/core/PersistenceBrokerFac toryDefaultImpl.html#createPersistenceBroker e.g. (One listener instance for all brokers ) protected PersistenceBroker createNewBrokerInstance(PBKey key) throws PBFactoryException { PersistenceBroker newBrokerInstance = super.createNewBrokerInstance(key); newBrokerInstance.addListener(yourListenerInstance) return newBrokerInstance; } c) Change PersistenceBrokerFactoryClass entry in OJB.properties to point to your new class e.g. ##PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBroker FactoryDefaultImpl PersistenceBrokerFactoryClass=com.mycompany.MyBrokerFactory d) There is no d) Cheers, Charles. -----Original Message----- From: Nils Liebelt [mailto:[EMAIL PROTECTED] Sent: 07 April 2005 13:55 To: 'OJB Users List' Cc: [EMAIL PROTECTED] Subject: OJB Listener :: Best practise Hi everybody, I need a simple Listener which methods get called after insert, update and delete. I just found Listener for Transaction stuff in the API. Any suggestions? GreetZ Nils ___________________________________________________________ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
