From users-return-26558-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Fri Mar 9 19:05:07 2018 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C59541765F for ; Fri, 9 Mar 2018 19:05:07 +0000 (UTC) Received: (qmail 4247 invoked by uid 500); 9 Mar 2018 19:05:07 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 4201 invoked by uid 500); 9 Mar 2018 19:05:07 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 4189 invoked by uid 99); 9 Mar 2018 19:05:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2018 19:05:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6777FC88B0 for ; Fri, 9 Mar 2018 19:05:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.192 X-Spam-Level: *** X-Spam-Status: No, score=3.192 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aW_7AbW7hvis for ; Fri, 9 Mar 2018 19:05:04 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 94C155F5B1 for ; Fri, 9 Mar 2018 19:05:03 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id v9-v6so14582589lfa.11 for ; Fri, 09 Mar 2018 11:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=vF21g/gZmojnTJIv1KT5rAK1k/268I6iaOKjESDx6VU=; b=H7c8kNGJLG7az7StGUjR1x5bb46Ta1LHxhJocXk+fkz6cxtSQq5apm8Yzy/pUjuS8X wby4aGdeom0W4r6oSZEsyr+rtHU3sxUgDWDWYFrJKtmqgj3q93o7J/Sed8nKAVSkJ1N/ scQjmZBXxY6fGbCIfaIsQHkJglZTJhWFsKPoSVls27KlAjrPDdV8nk1h4mR/IjMikGFG ZUND4Wso4SSSrvDP/FG5Lfn+YcSWl9G7dl3Q8fenODvUsXq+vBm3zcB1SwMqHRI9T9pH IxuweACuMUujMHBpDIHBGxQd7uz7ATRqOJ9a5bp9iWNx16CFPBsFoTzd2qALvH0W4C/a xeag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=vF21g/gZmojnTJIv1KT5rAK1k/268I6iaOKjESDx6VU=; b=RI0Bqz6KHcOj0TXgvA+iwKxxqyGALt8dDgE6i0J6UsjvQ20ZYrXeNSEiSSbUs0458U 9ijVwkIQWix9DjXLGAx/0pLTwW9k86EjGF2BLjT6QhpbWGA8277rkhSSKpRcIovwqT05 x9p+3sutVk8n0hFq65IjrfbTzJ1Nvs+rm+w5aUxgRwMQFsISNIH/aoFcfrWURBRVsTuw hU5gXkE7rnacFi7/rsBTWtwhSw9OOj9j2oF09zCC2rK/5kQ5Pdg5g0njLCMAIODky0+E A49huyPc7iS9aUiW8mrUvK5XH7vlcYoEL1iaTaLjfzB0k3zZMWfuvfnAJ+o8aC0YsIWJ WDrA== X-Gm-Message-State: APf1xPCVR/UovrT1CpRNo+T3PMOeTqdhDeIg7FeI1OJq0A2fKCmEJSGx E9QaDOTmxsgFl9ilxTSdoM/BUBcgSfEkomVCGMQ= X-Google-Smtp-Source: AG47ELuJ8gbFOdZcdBSoMkNMd32LVVx4Uomz0NITKusZE4g4CYBPi7kXWNuc57WgjUrYGnv9hqgmyBOEat0BLC8MVYU= X-Received: by 10.46.33.230 with SMTP id h99mr22974423lji.47.1520622302692; Fri, 09 Mar 2018 11:05:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.70.1 with HTTP; Fri, 9 Mar 2018 11:05:01 -0800 (PST) Received: by 10.46.70.1 with HTTP; Fri, 9 Mar 2018 11:05:01 -0800 (PST) In-Reply-To: <1520620812559-0.post@n4.nabble.com> References: <1520620812559-0.post@n4.nabble.com> From: Jonathan Gallimore Date: Fri, 9 Mar 2018 19:05:01 +0000 Message-ID: Subject: Re: Resource adapter - Connection - Pooling parameters To: users@tomee.apache.org Content-Type: multipart/alternative; boundary="001a1142b76e308b830566ff78fb" --001a1142b76e308b830566ff78fb Content-Type: text/plain; charset="UTF-8" If you're deploying a rar in an EAR file, then I believe you need to use system.properties to provide these settings, as TomEE will create the resources based on what is in the Rar's ra.xml. Another option is to include the jars from the rar directly in the ear file, and then you can define the resources for the connection factory etc in resources.xml. I'll dig out an example in about an hour's time. It would be a cool feature enhancement to be able to configure these resources defined in the rar from resources.xml. I'll see if I can provide that enhancement. I won't be able to do it straight away as my schedule is a bit full - possibly next week. Alternatively, I'm happy to give some pointers if someone else wants to have a go. I'm not sure if you can specify system properties within your app - I'll check. Jon On 9 Mar 2018 18:40, "jeankst" wrote: > Hi all, > > We moving from Weblogic to TomEE and deploying with a RAR within an EAR. > Here is what I got to work: > > In ra.xml: > > > foo.bar.MyResourceAdapter resourceadapter-class> > > > > foo.bar.ManagedConnectionFactory managedconnectionfactory-class> > > ServerName > java.lang.String > server001 > > ... > > > > foo.bar.ManagedConnectionFactory managedconnectionfactory-class> > > ServerName > java.lang.String > server002 > > ... > > ... > > > > On TomEE startup, in the logs, I can see: > > INFO [main] > org.apache.openejb.config.ConfigurationFactory.configureService > Configuring > Service(id=MyResourceAdapter, type=Resource, provider-id=MyResourceAdapter) > INFO [main] > org.apache.openejb.config.ConfigurationFactory.configureService > Configuring > Service(id=MyConnectionFactory1, type=Resource, > provider-id=MyConnectionFactory1) > INFO [main] > org.apache.openejb.config.ConfigurationFactory.configureService > Configuring > Service(id=MyConnectionFactory2, type=Resource, > provider-id=MyConnectionFactory2) > > So in a container managed bean, I use: > > @Resource(name = "MyConnectionFactory1", authenticationType = > Resource.AuthenticationType.APPLICATION, shareable = true) > private ConnectionFactory myFirstConnectionFactory; > > @Resource(name = "MyConnectionFactory2", authenticationType = > Resource.AuthenticationType.APPLICATION, shareable = true) > private ConnectionFactory mySecondConnectionFactory; > > In /conf/system.properties, I set pooling parameters as: > > MyResourceAdapter.threadPoolSize=7 > > MyConnectionFactory1.pooling=true > MyConnectionFactory1.poolMinSize=0 > MyConnectionFactory1.poolMaxSize=3 > MyConnectionFactory1.connectionMaxWaitTime=3 seconds > MyConnectionFactory1.connectionMaxIdleTime=1 minutes > > MyConnectionFactory2.pooling=true > MyConnectionFactory2.poolMinSize=1 > MyConnectionFactory2.poolMaxSize=2 > MyConnectionFactory2.connectionMaxWaitTime=5 seconds > MyConnectionFactory2.connectionMaxIdleTime=10 seconds > > So what I understood so far: > > - For Weblogic only a connection-definition is in ra.xml and > connection-instance(s) are in weblogic-ra.xml with the actual parameters > and > pooling settings > - For TomEE all connections (and their parameters) are defined in the > sole > ra.xml; pooling (pooling=true by default) is however set in > system.properties > > Questions: > > Is there a way do have those parameters embedded in the application EAR? > (instead of having to change the system.properties of the TomEE instance) > Is this possible using a resources.xml file? if so, what would be the > syntax to use according to the sample above? > > Thanks, > Jean. > > > > > -- > Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users- > f979441.html > --001a1142b76e308b830566ff78fb--