[daisy] [JIRA] Created: (DSY-468) Throw specific exception when an
optimistic locking exception occurs, instead of RepositoryException
Geoffrey De Smet (JIRA)
issues at cocoondev.org
Wed May 9 10:19:20 CDT 2007
Throw specific exception when an optimistic locking exception occurs, instead of RepositoryException
----------------------------------------------------------------------------------------------------
Key: DSY-468
URL: http://issues.cocoondev.org//browse/DSY-468
Project: Daisy
Type: Improvement
Components: Repository
Versions: 2.0.1
Reporter: Geoffrey De Smet
Priority: Trivial
So it can be caught and dealt with accordingly (show to the user), without having to catch RepositoryException and having to do:
if (e.getMessage().equals("The document variant was updated concurrently.")) ...
Pessimistic locking throws a nice DocumentLockingException. Optimistic locking could throw that too or a new exception class (which could extend RepositoryException of course).
Here's a stacktrace on a client:
Caused by: org.outerj.daisy.repository.RepositoryException: Received exception from repository server.
at org.outerj.daisy.repository.clientimpl.infrastructure.DaisyHttpClient.handleNotOkResponse(DaisyHttpClient.java:180)
at org.outerj.daisy.repository.clientimpl.infrastructure.DaisyHttpClient.executeMethod(DaisyHttpClient.java:111)
at org.outerj.daisy.repository.clientimpl.RemoteDocumentStrategy.store(RemoteDocumentStrategy.java:215)
at org.outerj.daisy.repository.commonimpl.DocumentImpl.save(DocumentImpl.java:430)
at be.schaubroeck.daisy.RepositoryTemplate$3.doExecute(RepositoryTemplate.java:216)
at be.schaubroeck.daisy.RepositoryTemplate.execute(RepositoryTemplate.java:67)
... 43 more
Caused by: org.outerj.daisy.repository.clientimpl.infrastructure.DaisyPropagatedException: [org.outerj.daisy.repository.RepositoryException] The document variant was updated concurrently.
Here's a stack trace on the server request:
ERROR ] <2007-05-09 16:33:26,439> (daisy.repository.httpconnector.request-errors): Error processing request /document/1692-sb
org.outerj.daisy.repository.RepositoryException: The document variant was updated concurrently.
at org.outerj.daisy.httpconnector.handlers.DocumentHandler.handleRequest(DocumentHandler.java:91)
at org.outerj.daisy.httpconnector.HttpConnectorImpl$PathHandler.handle(HttpConnectorImpl.java:299)
at org.outerj.daisy.httpconnector.HttpConnectorImpl$DaisyHandler.handle(HttpConnectorImpl.java:257)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
(not an urgent issue, just added it so it's tracked in jira)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the daisy
mailing list