Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DD4A2200CAD for ; Tue, 6 Jun 2017 07:26:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DC2AC160BE1; Tue, 6 Jun 2017 05:26:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0798F160BD4 for ; Tue, 6 Jun 2017 07:26:35 +0200 (CEST) Received: (qmail 92304 invoked by uid 500); 6 Jun 2017 05:26:30 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 92048 invoked by uid 99); 6 Jun 2017 05:26:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2017 05:26:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 03AD01857B1 for ; Tue, 6 Jun 2017 05:26:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.09 X-Spam-Level: ** X-Spam-Status: No, score=2.09 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIM_INVALID=0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=persistentsystems.onmicrosoft.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 36xBSJTpnK0E for ; Tue, 6 Jun 2017 05:26:22 +0000 (UTC) Received: from HJ-SMTP-OUT.persistent.co.in (hjoutgoing.persistent.co.in [103.6.33.101]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 3344D5F27B for ; Tue, 6 Jun 2017 05:26:20 +0000 (UTC) X-AuditID: 0a2d0811-f79b86d000000e95-bd-59363cf8df9f Received: from mail.persistent.co.in (Unknown_Domain [10.44.252.65]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by HJ-SMTP-OUT.persistent.co.in (HJ-SMTP-OUT @ Persistent Systems Ltd.) with SMTP id 7B.56.03733.8FC36395; Tue, 6 Jun 2017 10:56:16 +0530 (IST) Received: from IND01-BO1-obe.outbound.protection.outlook.com (10.45.0.30) by mail.persistent.co.in (10.44.252.65) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Jun 2017 10:56:12 +0530 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=persistentsystems.onmicrosoft.com; s=selector1-Persistent-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RMRPJu7xUStGoq4py5tTWvHgk3WhhYPFOriOFykaF7c=; b=jG1BI9F2GRWJFYcED9MpduPpGhkYUnq0H51CiYPfVw6EVxtPJnECJgF9trdOZYM1gQFUcwr3FU84/GfVNkywA7hWx8saIxe8p0gOHEtnAh4n4zwZLTUKbD7x33Bx63iQ9hyVRQjv7ndSw5ghs0CZiLwKPNvDvju3kgTUNF9AcZ4= Received: from MA1PR01MB1020.INDPRD01.PROD.OUTLOOK.COM (10.174.60.9) by MA1PR01MB1019.INDPRD01.PROD.OUTLOOK.COM (10.174.60.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 6 Jun 2017 05:26:10 +0000 Received: from MA1PR01MB1020.INDPRD01.PROD.OUTLOOK.COM ([10.174.60.9]) by MA1PR01MB1020.INDPRD01.PROD.OUTLOOK.COM ([10.174.60.9]) with mapi id 15.01.1143.018; Tue, 6 Jun 2017 05:26:10 +0000 From: Michael Harrison To: "users@jackrabbit.apache.org" Subject: Concurrrent use of Repositories Thread-Topic: Concurrrent use of Repositories Thread-Index: AQHS3ncE1WUmQTOGxkCQvY6Sa95BKw== Date: Tue, 6 Jun 2017 05:26:09 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: jackrabbit.apache.org; dkim=none (message not signed) header.d=none;jackrabbit.apache.org; dmarc=none action=none header.from=persistent.com; x-originating-ip: [72.5.224.23] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MA1PR01MB1019;7:dJO7uAW7dmTEcnr1eL7VzSSeQbnTClXKqUa3qiU9FXpBx5j+NP6VtCtuq5xLrSoT8y2O+71zv6YLxP1s/jL3iU6FZEbV9yxiadZNNNh4Be1jQ11mdaDCkfuAUZW+zi3bKKExaI8r5hK4L290TIxj0uHTwn9OPJAg99RdK7ckCEena9KZVJ3Se1UuZwVOxLbp3V4zju/JYoKvfE0bVi+l7VyXxlPg7AvtplMWct3KiOpQuYb5fFLl7BByZTGgTqVBogutob2eorM4f/0Mr8lBOz6u6VDPq8qtXsdPjdsWiAHOnznfrS6Jv45B38J6U/5qJEElFFc11l+C8ZEJ+06Syw== x-ms-traffictypediagnostic: MA1PR01MB1019: x-ms-office365-filtering-correlation-id: cc9cbf61-43b5-4743-65d5-08d4ac9c8a4d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:MA1PR01MB1019; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MA1PR01MB1019;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MA1PR01MB1019; x-forefront-prvs: 033054F29A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39450400003)(39850400002)(39840400002)(39400400002)(66066001)(122556002)(1730700003)(38730400002)(110136004)(6506006)(81166006)(2900100001)(5660300001)(2351001)(2906002)(77096006)(74316002)(54896002)(19627405001)(3480700004)(53936002)(478600001)(8676002)(55016002)(189998001)(9686003)(6436002)(5640700003)(3660700001)(3280700002)(54356999)(6606003)(6116002)(50986999)(86362001)(8936002)(7696004)(25786009)(2501003)(7736002)(102836003)(3846002)(14454004)(6916009)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:MA1PR01MB1019;H:MA1PR01MB1020.INDPRD01.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_MA1PR01MB10201E31E7BCC7DFC4EFB04A9ACB0MA1PR01MB1020INDP_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jun 2017 05:26:09.9567 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1f4beacd-b7aa-49b2-aaa1-b8525cb257e0 X-MS-Exchange-Transport-CrossTenantHeaders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uK5XQAOZgAbyXTIBGQjMmHApqQZG889/dv6RVHUvj41wTt7opNG90Pjob87M hDQ316g9k/hE7+6fyp+yrO7+uvlf5zEtD+mwnnhr7/HJM46rxOTbabnJHhZccrdyv5U2/+zE 6HcGX3ao2/33aZq4vXOmeEPj1IzV335MvLGOTTrX42Xwbp65aYu7bxQfXj9Ldlvqih05Go5K vXbJSizFGYmGWsxFxYkAGD59VGkEAAA= archived-at: Tue, 06 Jun 2017 05:26:37 -0000 --_000_MA1PR01MB10201E31E7BCC7DFC4EFB04A9ACB0MA1PR01MB1020INDP_ Content-Type: text/plain; charset="iso-8859-1" content-transfer-encoding: quoted-printable We are just starting to use Oak (version 1.6.1) backed by a file store. We h= ave two concurrent processes trying to access the data in the file store, ea= ch process using its own Repository interface. As a simple test case we have= the following. Process1 has this code (imports omitted to save space): public class HoldSessionOpen { private static String workspace =3D "default"; private static String repodir =3D "\\tmp\\oak-repo"; public static void main(String[] args) throws Exception { FileStore filestore =3D FileStoreBuilder.fileStoreBuilder(new File(r= epodir)).build(); try { SegmentNodeStore sns =3D SegmentNodeStoreBuilders.builder(filest= ore).build(); Repository repository =3D new Jcr(new Oak(sns)).createRepository= (); SimpleCredentials creds =3D new SimpleCredentials("admin", "admi= n".toCharArray()); Session session =3D repository.login(creds, workspace); try { System.out.println("Holding session: " + session); Node root =3D session.getRootNode(); for (int i =3D 0; i < 100000; i++) { if (root.hasNode("hold")) { Node hold =3D root.getNode("hold"); long count =3D hold.getProperty("count").getLong(); hold.setProperty("count", count + 1); System.out.println("found the hold node, count =3D "= + count); } else { System.out.println("creating the hold node"); root.addNode("hold").setProperty("count", 1); } } session.save(); } finally { session.logout(); } } finally { filestore.flush(); filestore.close(); } } } and process2 has this code: public class AccessRepo { private static String workspace =3D "default"; private static String repodir =3D "\\tmp\\oak-repo"; public static void main(String[] args) throws Exception { FileStore filestore =3D FileStoreBuilder.fileStoreBuilder(new File(r= epodir)).build(); try { SegmentNodeStore sns =3D SegmentNodeStoreBuilders.builder(filest= ore).build(); Repository repository =3D new Jcr(new Oak(sns)).createRepository= (); SimpleCredentials creds =3D new SimpleCredentials("admin", "admi= n".toCharArray()); Session session =3D repository.login(creds, workspace); try { Node root =3D session.getRootNode(); if (root.hasNode("hello")) { Node hello =3D root.getNode("hello"); long count =3D hello.getProperty("count").getLong(); hello.setProperty("count", count + 1); System.out.println("found the hello node, count =3D " += count); } else { System.out.println("creating the hello node"); root.addNode("hello").setProperty("count", 1); } session.save(); } finally { session.logout(); } } finally { filestore.flush(); filestore.close(); } } } If I open up two consoles and start process1 in one and then process2 in the= other, process2 is blocked until process1 terminates. The actual use case is that one process is responding to REST requests for d= ata in the repository while another process is uploading content to the same= repository, but we see the same behavior - the process that starts second i= s blocked until the process that starts first completes. Is there any way to have concurrent access to the same data through two repo= sitories? DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privileged and confidential information which is the= property of Persistent Systems Ltd. It is intended only for the use of the= individual or entity to which it is addressed. If you are not the intended= recipient, you are not authorized to read, retain, copy, print, distribute= or use this message. If you have received this communication in error, plea= se notify the sender and delete all copies of this message. Persistent Syste= ms Ltd. does not accept any liability for virus infected mails. --_000_MA1PR01MB10201E31E7BCC7DFC4EFB04A9ACB0MA1PR01MB1020INDP_--