Java XAM API: can XSystem instance be shared across threads?
We have a system connecting to EMC Centera via the Java XAM API. Currently we create a new XSystem instance when needed, read/write as necessary and then close the instance. We potentially can have many concurrent read/write operations on multiple threads, so each thread has its own XSystem instance.
However, creating an XSystem instance is a relatively expensive operation, and is having an adverse effect on performance. My question is: do I only need to create a single (static) XSystem instance that can then be used across all threads? Is there any problem with keeping a connection open for an indefinite period? Is it possible for the connection to time out? If so, how can I detect this?
mckeown_paul
409 Posts
322
1
Posted March 28th, 2011 08:00
You should do one xsystejm connect when your application starts and use it for all your IO threads and only close it when your application terminate
The connetion will not timeout.
This is our best practise recommendation for xsystem connection management