I forgot that since the server was started and the database constructed in the singleton, any new instances will still have access to it. I was using the client session as a permanent object rather than recreating these for each class instance.
-----Original Message----- From: Christian GrĂ¼n [mailto:christian.gruen@gmail.com] Sent: Thursday, September 18, 2014 7:25 AM To: Bondeson, Carl Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Multi threaded application
Hi Carl,
Exception: Unknown Query ID:
The exception indicates that you are launching concurrent queries with a single client session. I surely know too less about your concrete implementation, but are the some specific reasons for avoiding the creation of multiple ClientSession objects?
Best, Christian
I have using BaseX in a canonical manner to handle the many translations used in ELR systems. I won't get into specifics but it has been working well. I started looking into the use of a singleton database object in place of the many ClientSession objects created in the constructor of the associated classes. In a single thread the performance varied between a 2x and 5x decrease. That would be expected since the amount of i/o required to load the XML would be replaced by simply executing queries against the database. The application that is utilizing BaseX is multithreaded. Once I deployed the application in JBoss I continue to receive exceptions:
These class methods are "synchronized" and are being invoked via Xalan callouts from XSLT.
I am currently using version 7.9 from the Maven repository.
Is BaseX thread safe in this manner?
Carl R Bondeson Systems Developer Department of Public Health Data Processing 410 Capitol Ave Hartford, CT 06134 Phone: 860-509-7434 carl.bondeson@ct.gov