Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoJmh-0007J8-VN for pgsql-jdbc@arkaria.postgresql.org; Wed, 04 Dec 2013 21:15:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VoJmh-00043b-CP for pgsql-jdbc@arkaria.postgresql.org; Wed, 04 Dec 2013 21:15:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoJmg-00043H-PO for pgsql-jdbc@postgresql.org; Wed, 04 Dec 2013 21:15:02 +0000 Received: from mail-pb0-f48.google.com ([209.85.160.48]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoJmd-0006rv-4B for pgsql-jdbc@postgresql.org; Wed, 04 Dec 2013 21:15:02 +0000 Received: by mail-pb0-f48.google.com with SMTP id md12so24102971pbc.7 for ; Wed, 04 Dec 2013 13:14:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=dyBnnkuD3cdoFtXgsDO+0I9F2sHFaN7XHmv4RLsURP8=; b=l75VhMbCXsUnUmL4I2Eoh7pJvPElm0vU14ofMDPp7xThTgQbgzJlkbrn32SXr+bdNl CyoTrLlN1FrFZtULaVzIPRca/KlCIBZ6YGg2jWlPZiTHvzNVWPaFmRgz4Ly6iC7o0EMn uXrLVaXrPdy6j6FQyYZTdI4bl31vxFxsJXxB1gOCzFpFsbbxjKtwfFwnhvsQTmYUONIV /hjN4vUOx+hpXLGYr3vJa0fQrHeBK2Tg8BEvAgqCtD+HiASpRr/Y6pUprc39MV6P+y6b kVcT3fXyrR+9x2DAc7jI8gW4V+YeihumvUZvn0ENlNwmD3NuIEtmZrqI/sUzdlRvt049 ZijA== X-Gm-Message-State: ALoCoQmpoZmRlzzJnWd7x7Q3/9NhtCCox49kmBopK9IQfWY/GSpvKHYCz3P5em3Ps/XoHOdcLw2D X-Received: by 10.68.130.234 with SMTP id oh10mr48579127pbb.0.1386191697434; Wed, 04 Dec 2013 13:14:57 -0800 (PST) Received: from sherlock.maginatics.com (c-69-181-104-115.hsd1.ca.comcast.net. [69.181.104.115]) by mx.google.com with ESMTPSA id ie6sm113286092pbc.6.2013.12.04.13.14.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 04 Dec 2013 13:14:57 -0800 (PST) Date: Wed, 4 Dec 2013 13:14:56 -0800 From: Andrew Gaul To: Dave Cramer Cc: List Subject: Re: JDBC lint Message-ID: <20131204211456.GF12296@sherlock.maginatics.com> References: <20131204193756.GD12296@sherlock.maginatics.com> <20131204204126.GE12296@sherlock.maginatics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Use of JDBC lint could allow removing the finalize methods from the underlying driver resources. One could even opt-in to such behavior, such as MySQL Connector/J configuration for dontTrackOpenResources=true. The referenced thread discusses the need for such a debug mode and JDBC lint provides this functionality. On Wed, Dec 04, 2013 at 03:45:08PM -0500, Dave Cramer wrote: > Andrew, > > The discussion you referenced is actually the jdbc code itself use of > finalizers and closing resources > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > On Wed, Dec 4, 2013 at 3:41 PM, Andrew Gaul wrote: > > > JDBC lint does not fix JDBC driver use of finalization, instead it > > informs users that they did not explicitly close a resource. Users > > explicitly closing allows the finalizer thread to quickly return if a > > resource has already closed, instead of doing a heavyweight resource > > deallocation. This tends to have better behavior since the JVM has a > > limited number of finalizer threads. > > > > On Wed, Dec 04, 2013 at 03:14:58PM -0500, Dave Cramer wrote: > > > Andrew, > > > > > > How would this fix the jdbc drivers use of finalizers ? > > > > > > Dave Cramer > > > > > > dave.cramer(at)credativ(dot)ca > > > http://www.credativ.ca > > > > > > > > > On Wed, Dec 4, 2013 at 2:37 PM, Andrew Gaul wrote: > > > > > > > JDBC lint helps Java programmers write correct and efficient code when > > > > using the JDBC API. This includes resource management, e.g., missing > > > > Connection.close, incorrect use of JDBC, e.g., Statement.addBatch > > > > without Statement.executeBatch, and potential optimizations, e.g., > > > > unread ResultSet columns. JDBC lint wraps DataSource and Connection > > and > > > > via dynamic proxy classes and thus has compatibility with all > > > > applications using JDBC. I tested against H2, MySQL, and PostgreSQL > > and > > > > hope users find this helpful: > > > > > > > > https://github.com/maginatics/jdbclint > > > > > > > > JDBC lint might help address issues discussed in the thread, > > > > "Remove usage of finalizers?": > > > > > > > > > > > > > > http://www.postgresql.org/message-id/9E5438C0-0A2E-4543-BE06-1E7A6D0E3B83@pilhuhn.de > > > > > > > > I appreciate any feedback! > > > > > > > > -- > > > > Andrew Gaul > > > > http://maginatics.com/ > > > > > > > > > > > > -- > > > > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > > > > To make changes to your subscription: > > > > http://www.postgresql.org/mailpref/pgsql-jdbc > > > > > > > > -- > > Andrew Gaul > > http://maginatics.com/ > > -- Andrew Gaul http://maginatics.com/ -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc