Java SDK 1.1.1 - Avoid runtime exceptions during deletion
I´ve big issues with those synchronous implementation of couchbase requests in the JAVA Api. Unfortunately I can never just find out, in what state the server actually is.
My singleton implementation of the client holds the connection. And because there is no possibility for me to get the delta between old and new data, I have to flush/delete the bucket and create a new one.
Because I have an huge amount of data, flushing the bucket forces Runtime Exceptions due to request timeouts after 60 seconds and is not usable.
After the connected client has nothing to do for hours (lets say 6h - and this is the only reasonable answer to me), I just instanciate a ClusterManager to delete the bucket. The deletetion after this period of "sleeping" always ends with
java.lang.RuntimeException: Http Error: 500 Reason: Internal Server Error Details: No reason given
Of course, the Admin API describes this timeout http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-admin-resta..., but how to check if it is deleted or not?
The most upsetting thing about is, that the bucket is deleted actually and there is no way to create the bucket in the next step.
Because when I handle this exception, I´ll try to create the bucket again through a fresh instance of ClusterManager and always got this error
java.lang.RuntimeException: Http Error: 503 Reason: Service Unavailable Details: No reason given
So please tell me, how the hack will my application ever be available, if this part fails every night and I have to restart my application to have a connected client????? Is the server in a sleep mode after a while and how do I avoid this? I mean, as long as my client has a connection, this should never happen... This is a show stopper for an productive environment.