I've been using OJB in JBoss for a while, and I haven't started to use proxies yet 
because I couldn't get proxies to materialize their objects in other VM's. I know I 
could use the server mode, but that just felt wrong for the j2ee environment for some 
reason, so I put together a PersistenceBrokerBean which is a standard SessionBean that 
implements the PersistenceBroker API. Each call to the PersistenceBrokerBean will take 
place in it's own transaction. Certain PB operations make no sense in this 
configuration, and will throw exceptions to indicate this. The application server will 
be responsible for maintaining a pool of these PersistenceBrokerBeans to service 
requests. Configuration for the PersistenceBroker will be indicated in the deployment 
descriptor (which repository to work with, JNDI name, etc).
 
If the group gives it a thumbs up, I will alter the IndirectionHandler and/or 
persistenceBrokerFactory to have configurations for using the PersistenceBrokerBean to 
materialize proxies. 
 
A side effect is that users will be able to use the PersistenceBrokerBean as a 
persistence API from a servlet engine to an EJB server. Dunno how useful this is, but 
it will work.
 
cheers,
Matthew
 
btw: XDoclet is cool.


Reply via email to