#: Marcel Reutegger changed the world a bit at a time by saying on  12/5/2005 
11:54 AM :#
personally I think applications should only use a shared repository that is deployed as a resource. either through some standard mechanism such as RARs or some proprietary servlet engine mechanism.

e.g. use the jca contribution in jackrabbit.

In any case, the servlet engine or the application server should control the life cycle of the repository (resource) and not the application itself. (unless the repository is embedded into the application).

regards
  marcel


I fully agree that normally the server should be responsible with this task. However, I don't remember that the servlet engines are required to conform to JCA spec.

Doing more digging I guess an even easier way to accomplish what I have suggested and still not expose the BindableRepository is to have the BindableRepository return true/false according to the fact if it triggered the RepositoryImpl.shutdown(). The RegistryHelper.unregister method can check this return and unbind the repository (the unbinding is still tricky as some of the JNDI are read-only).

./alex
--
.w( the_mindstorm )p.


Alexandru Popescu wrote:
Hi!

I have been reading about the decissions around the BindableRepository and why or why not make it package vs public level.

I was wondering how to handle the following scenario:

2 applications A & B using a shared repository
application A starts the repository
application B retrieves it through JNDI
application A is shutdown for maintanance (the repository shouldn't be closed, still being used by B)
JVM is shutting down

This results imo in a not-shutdown repository.

IMO a better approach would be to have the BindableRepository public and its shutdown public, so that every application relying on it can `try´ to close the repository. I am saying `try´ because the BindableRepository should be able to find out if it is still referenced and trigger the RepositoryImpl.shutdown only when the last referencing application is triggering the shutdown.

Please let me know what do you think about this. If you agree with this scenario I can (almost) immediately provide the patched version.

thanks in advance,

./alex
--
.w( the_mindstorm )p.








!DSPAM:43940e7258489828750033!




Reply via email to