Unsolved
This post is more than 5 years old
4 Posts
0
3512
December 9th, 2009 04:00
How can I know if a FPPool is useless and I need re-create it?
Hello all.
My name is Antonio and I'm a Java developer. Our application is made in Java and we're using "multithreading" to access to Centera (reading and writing files). We want to build a Singleton class to wrap the FPPool object, with a static instance and a method to invalidate it.
We would call the invalidate method if we receive an error related to the connection, but what errors are those?
I think they would be:
- FPLibraryException.FP_ACCESSNODE_ERR
- FPLibraryException.FP_NETWORK_ERROR_BASE
- FPLibraryException.FP_ERROR_BASE
- FPLibraryException.FP_NO_POOL_ERR
- FPLibraryException.FP_NOTYET_OPEN_ERR
- FPLibraryException.FP_POOLCLOSED_ERR
- FPLibraryException.FP_UNABLE_TO_GET_LAST_ERROR
But, When would we re-create the instance? What errors with?
For example, if i got a FPLibraryException with a FP_NETWORK_ERROR_BASE error and i re-create the FPPool object, i'll got the same error because the network could be unreachable. Is this correct?
Thanks a lot.


gstuartemc
2 Intern
•
417 Posts
0
December 9th, 2009 04:00
Hi Antonio - if you lose the pool connection, all transactions that access the cluster will return an error.
Of the ones you mention, the following would indicate that a previously established valid Pool connection should be re-established.
- FPLibraryException.FP_NO_POOL_ERR
- FPLibraryException.FP_POOLCLOSED_ERR
Also, FPLibraryException.FP_WRONG_REFERENCE_ERR may also indicate that (for API calls that take a Pool reference as a parameter).
You will never receive any of the "BASE" errors - these are simply numbers signifying the start of a range for an error class in the header files.
For Network class errors, as these are capable of succeeding on retry they do not mean that the Pool reference must be re-established.
BTW - I like your design. The person who thought of that must be a genius.
paulb102
7 Posts
0
December 16th, 2009 06:00
Apologies for the (undoubtedly) newbie question.
If I have singleton wrapper for the FPPool object and my invalidate method calls FPPool.Close() should I expect to see the following exception from the SDK - "The FPPool this object belongs to is already closed"? I presume this is thrown for any inflight transactions between my app and the Centera store?
Secondly I noticed in the SDK JavaDocs the following comment for the FPPool.Close method - "Be aware that using this function on a pool that has already been closed, may produce unwanted results." Does anybody know what these unwanted results may be?
Thanks.
gstuartemc
2 Intern
•
417 Posts
0
December 16th, 2009 06:00