Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7rjn-0008BB-SS for pgsql-sql@arkaria.postgresql.org; Tue, 31 May 2016 22:02:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b7rjn-0004qV-Ex for pgsql-sql@arkaria.postgresql.org; Tue, 31 May 2016 22:02:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b7riq-0002kH-2X for pgsql-sql@postgresql.org; Tue, 31 May 2016 22:01:12 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b7ril-0002ew-S8 for pgsql-sql@postgresql.org; Tue, 31 May 2016 22:01:11 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A443C20784; Tue, 31 May 2016 18:01:05 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 31 May 2016 18:01:05 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=3K3pdSzmkPXMen8zAyd+rvHo5ZM=; b=Fr6GJ3 eVQkjtVCeWlbzLk8Vht9aasDP+vRVyhMoA8GrCh+C1H6plG1I3OSEqqgCUrtmc+V IkSywpl2m2jXwhCrMWAmeMrAIOaKxsaYUEWzXUfMeGUvdXIwD8cED4oqnB9ugCkn aClBGsaK1hrnsLwihmn/Ll8YGWmdkgB4mkENY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=3K3pdSzmkPXMen8 zAyd+rvHo5ZM=; b=eKQpXGYw0ZVo39eJ6VE516lwpTRletqyDZ2es+ZjekJeZ2Q bdgrnvLBNA/BI9aY8jCX5VkZUAsb9J/EfaEpxiXfExtTiYgQyCSaAFzsROrxFNHM 9i4mpwMXqpghODJBqEQNku1Z89vK0NET7G8f9dodjoap4+uzgCgqTYILLrjM= X-Sasl-enc: utTzQd0ALuprjBaaph/q+8EuZDkucxeCJHo+azH+UMpa 1464732065 Received: from killi.site (c-73-225-242-52.hsd1.wa.comcast.net [73.225.242.52]) by mail.messagingengine.com (Postfix) with ESMTPA id 18ABFCC07A; Tue, 31 May 2016 18:01:05 -0400 (EDT) Subject: Re: jdbc and postgresql function session question To: Michael Moore , postgres list References: From: Adrian Klaver Message-ID: Date: Tue, 31 May 2016 15:01:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 05/31/2016 02:20 PM, Michael Moore wrote: > When the postgres jdbc driver calls a postgres function, does it get a > new session every time? If I create a PREPARED statement on the first > call, will it still be available on the 2nd call? If not, is there any > way I could get the prepared statement to be used on successive calls? I think this is going to need more explanation, so: 1) When you say session are you talking about connection or a transaction? A function will run in its own transaction each time, but can be run multiple times in a connection. 2) Where is the PREPARED statement being built, in the function or outside it? 3) Can show an outline of what you are doing? > TIA, > Mike\ > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql