[
http://issues.apache.org/jira/browse/COCOON-1862?page=comments#action_12417049
]
Antonio Gallardo commented on COCOON-1862:
------------------------------------------
I am sorry for my initial comment. It does not make sense. I think I did not
read it correctly. Anyhow, here is another solution without using the
DatabaseManager, can you kindly try it:
/** Stop the server */
public void stop() {
getLogger().debug("Shutting down HSQLDB");
hsqlServer.setNoSystemExit(true);
hsqlServer.stop();
hsqlServer.shutdown();
getLogger().debug("Shutting down HSQLDB: Done");
}
BTW, I wonder if hsqlServer.stop() is needed at all in this case. If this
works, please try also to remove the line "hsqlServer.stop();"
> HSQLDB improper shutdown
> ------------------------
>
> Key: COCOON-1862
> URL: http://issues.apache.org/jira/browse/COCOON-1862
> Project: Cocoon
> Type: Bug
> Components: Blocks: HSQL Database
> Versions: 2.1.8, 2.1.9
> Reporter: Igor Naumov
> Priority: Minor
>
> On some J2EE servers (WebSphere, SAP NetWeaver), HSQLDB server that is
> started with Cocoon is not shut down properly when an application is stopped.
> For some reason even though the server stops, the DB's lock and log files
> remain locked and that prevents the database startup when the application is
> started again.
> If the ServerImpl for HSQLDB block explicitely closes all the databases, the
> locks are released and the problem does not occur.
> To close the databases, the following code was added to
> cocoon-2.1.9\src\blocks\hsqldb\java\org\apache\cocoon\components\hsqldb\ServerImpl.java
> @@ -35,6 +35,9 @@ import org.apache.avalon.framework.threa
> import org.apache.cocoon.Constants;
> import org.apache.cocoon.components.thread.RunnableManager;
>
> +import org.hsqldb.Database; /** Only needed for a close mode constant */
> +import org.hsqldb.DatabaseManager;
> +
> /**
> * This class runs an instance of the HSQLDB HSQL protocol network database
> server.
> *
> @@ -145,6 +148,8 @@ if (null != runnableManager)
> /** Stop the server */
> public void stop() {
> getLogger().debug("Shutting down HSQLDB");
> + DatabaseManager.closeDatabases(Database.CLOSEMODE_COMPACT);
>
> hsqlServer.stop();
> getLogger().debug("Shutting down HSQLDB: Done");
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira