Hi Michele,
I've spoken to you about this before privately and explained to you that
investigating this problem would take a long time indeed.
It appears that the code creates 10 concurrent connections and "open
transactions" on the database at the same time.
Have you tried opening 10 connections with an according 10 concurrent
OPEN-transactions on the Database with either Sedna Team MODIS Driver or
even se_term? Or even getting the same thing to work with the Team MODIS
Java driver?
Are you aware that the following code:
DatabaseManager.getCollection(String, String, String)
will create you a brand new Sedna Connection / Socket?
Please investigate as much as you can about this and identifying where the
issue resides (Sedna XML Database or Sedna XML:DB Driver), The fact the
error message is SEDNA Message: ERROR SE4703... would suggest it is at the
Server end, but please first find this out.
Regards,
Charles
> Hi,
>
> I've encountered a problem when I try to use a Sedna XML:DB API for Java
> in
> a multithreading application.
>
> When more than one thread try to store a different resource in the same
> collection and the operation is bounded in one transaction I get the
> following error:
>
> SEDNA Message: ERROR SE4703 The transaction is a victim of deadlock
> resolution procedure.
>
> This is the test code for replicate the problem:
>
>
>
>
> import org.xmldb.api.DatabaseManager;
> import org.xmldb.api.base.Collection;
> import org.xmldb.api.base.Database;
> import org.xmldb.api.base.Resource;
> import org.xmldb.api.base.XMLDBException;
> import org.xmldb.api.modules.CollectionManagementService;
> import org.xmldb.api.modules.TransactionService;
> import org.xmldb.api.modules.XMLResource;
>
> public class Test3 {
> public Test3() throws Exception {
>
> Database sednaDatabase;
> Class<?> clazz = Class.forName("net.cfoster.sedna.DatabaseImpl");
> sednaDatabase = (Database) (clazz.newInstance());
> DatabaseManager.registerDatabase(sednaDatabase);
>
> int numThread = 10;
> final Thread[] listThread = new Thread[numThread];
>
> for (int i = 0; i < numThread; i++) {
>
> final int count = i;
>
> listThread[i] = new Thread(new Runnable() {
> public void run() {
> Collection root = null;
> TransactionService transactionService = null;
> try {
> root =
> DatabaseManager.getCollection("xmldb:sedna://localhost:5050/Test",
> "SYSTEM",
> "MANAGER");
> transactionService = (TransactionService)
> root.getService("TransactionService", "1.0");
> transactionService.begin();
> Resource r = root.createResource("test" + count,
> XMLResource.RESOURCE_TYPE);
> r.setContent("<test/>");
> root.storeResource(r);
> transactionService.commit();
> } catch (Exception e) {
> e.printStackTrace();
> try {
> transactionService.rollback();
> } catch (XMLDBException e1) {
> e1.printStackTrace();
> }
> } finally {
> try {
> root.close();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
>
> });
>
> }
> System.out.println("init");
> for (int i = 0; i < numThread; i++) {
> listThread[i].start();
> }
>
> for (int i = 0; i < numThread; i++) {
> listThread[i].join();
> }
> System.out.println("end");
> System.exit(0);
> }
>
>
>
> public static void main(String[] args) {
> try {
> new Test3();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.
> http://p.sf.net/sfu/bobj-july_______________________________________________
> Sedna-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sedna-discussion
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion