Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCFF6FA4B for ; Tue, 2 Apr 2013 00:54:16 +0000 (UTC) Received: (qmail 41060 invoked by uid 500); 2 Apr 2013 00:54:16 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 41002 invoked by uid 500); 2 Apr 2013 00:54:16 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 40994 invoked by uid 99); 2 Apr 2013 00:54:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 00:54:16 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 00:54:12 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UMpTz-000609-84 for users@openjpa.apache.org; Mon, 01 Apr 2013 17:53:51 -0700 Date: Mon, 1 Apr 2013 17:53:51 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Message-ID: <1364864031240-7583311.post@n2.nabble.com> In-Reply-To: <1364676665399-7583302.post@n2.nabble.com> References: <1364676665399-7583302.post@n2.nabble.com> Subject: Re: DistributionPolicy help MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Examples of Slice Distribution Policy can be found in OpenJPA test corpus. You can either OpenJPA source code and navigate to openjpa-slice/src/test/java/org/apache/openjpa/slice/policy package, or you can browse the source code in fisheye [1]. The context variable passed to DistributionPolicy is declared as an opaque java.lang.Object type. But in the runtime actually it is an instance of the EntityManagerFactory on which the perisist() call has been invoked. The interface method distribute() should return the name of one of the slices as declared in your persistence.xml. The object will be persisted in that slice. [1] https://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/policy/EvenOddDistributionPolicy.java?r=772721 ----- Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/DistributionPolicy-help-tp7583302p7583311.html Sent from the OpenJPA Users mailing list archive at Nabble.com.