Hi Richard, On Wed, Jun 4, 2008 at 10:35 AM, Richard Eckart <[EMAIL PROTECTED]> wrote: > Hello there, > > I have recently switched from my own home-cooked version of session > variables to using the UIMAContext > session. Actually I am using the UIMAContextAdmin-rootContext for storing my > session variables as I need them to set them in the CollectionReader and > read them in the CASConsumer. >
The Session support is actually not intended for sharing information between components, and it's not really fully implemented anyway. See this email: http://www.mail-archive.com/[EMAIL PROTECTED]/msg04364.html. > However, unless I set the casPoolSize to 1 I am having the problem that the > CollectionReader already overwrites the session variable which the > CASConsumer has not yet read. > > Before I had encoded my variables as an annotation within the CAS which > worked fine. > It sounds like the values of these variables pertain to a particular CAS (since you don't want the values to change until that CAS has been fully processed). If so, then storing them them in the CAS was a fine solution. The CollectionReader and CAS Consumers run in separate threads, so the CollectionReader definitely may move on to a new CAS before the CAS Consumer processes the first one. If you wanted your Collection Reader and CAS Consumer so share data that was *not* related to a particular CAS, you could use UIMA's external resource mechanism to accomplish that. -Adam
