I develop an application that works with Content Manager com.ibm.mm.beans classes.
I know from the documentation that it is not possible to share a single CMBConnection instance by multiple threads:
"A single instance of the CMBConnection bean can only be used on a single thread at any point in time." (link)
Hence, the threads in my application use the CMBConnectionPool to get and release connections.
Because of the application design, it would be beneficial to be able to share CMBItems across threads, e.g.:
- [thread-1] Uses CMBQueryService and CMBSearchResults to fetch some CMBItem from the server. The CMBItems are then added to a queue for further processing;
- [thread-2] Takes one item from the queue, calls cmbItem.setConnection(thread2Connection), and does some work with the item (like downloading it's contents).
Even though I'm replacing the CMBItem's connection by the one that's exclusively used by thread-2, I was able to see in a profiler that thread-2 is still blocked by resources owned by thread-1. I concluded then that replacing the CMBItem connection is not enough. Actually, this old support page states exactly that:
"The APIs do not directly support multiple threads using the same connected session and the objects obtained from that connected session." (My emphasis added)
That support page only applies for CM 8.1 and 8.2, though. Is there a way of sharing CMBItem instances across threads in CM 8.5 or 8.6? Is there any other objects apart from CMBConnection that I need to replace in the bean?
#IBMContentManager(CM8)#Support#SupportMigration