Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 66251 invoked from network); 29 Apr 2005 23:09:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Apr 2005 23:09:49 -0000 Received: (qmail 93912 invoked by uid 500); 29 Apr 2005 23:11:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 93875 invoked by uid 500); 29 Apr 2005 23:11:10 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 93862 invoked by uid 99); 29 Apr 2005 23:11:10 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.133) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 29 Apr 2005 16:11:09 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j3TN9eLg387604 for ; Fri, 29 Apr 2005 19:09:44 -0400 Received: from [127.0.0.1] (IBM-IKEJ04B1IMA.usca.ibm.com [9.72.133.56]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j3TN9cI3368698 for ; Fri, 29 Apr 2005 17:09:40 -0600 Message-ID: <4272BEB0.1050305@sbcglobal.net> Date: Fri, 29 Apr 2005 16:09:36 -0700 From: Mike Matrigali User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: [jira] Updated: (DERBY-243) connection toString should uniquely identify the connection References: <1417326426.1114706960485.JavaMail.jira@ajax.apache.org> <4272BB12.8000107@sun.com> In-Reply-To: <4272BB12.8000107@sun.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I am not sure where the following information is contained, but somehow the log statement text trace in a network server connection use to associate a "session id" with a connection. So derby.log statments would be tagged with this info. This is what I always used to understand the path of a connection within the log (often people will use thread id which can work, but does not work if connection pooling is involved). This did not provide any sort of unique id for a given network server, though I don't know if that is necessary. Maybe someone knows if this info is available to the EmbedConnection class, maybe from the context manager? David Van Couvering wrote: > Hi, Kathey. Currently the connection classes don't appear to have a > unique identifier that could be made available in toString(). Do I take > it you would like me to find an approach that generates one? > > I noticed Derby has a UUID service (very nice!). Is it OK if I use that > here to generate a UUID for the connection? If I don't hear otherwise, > I'll assume this approach is OK, e.g. > > public class EmbedConnection > { > private UUID UUIDValue; > private String UUIDString; > > public EmbedConnection() > { > UUIDFactory uuidFactory = Monitor.getMonitor().getUUIDFactory(); > UUIDValue = uuidFactory.createUUID(); > UUIDString = this.getClass().getName() + ":" + UUIDValue.toString(); > ... > } > > public String toString() > { > UUIDString; > } > } > > ===== > > The connection classes I found are as follows. Please let me know if I > missed any. An indented class implies it extends the unindented class > above it. > > EMBEDDED (org.apache.derby.engine.*) > BrokeredConnection (implements java.sql.Connection) > BrokeredConnection30 > EmbedConnection (implements java.sql.Connection) > EmbedConnection30 > EmbedPooledConnection (implements java.sql.PooledConnection) > EmbedXAConnection > > CLIENT (org.apache.derby.client.*_ > Connection (abstract class, implements java.sql.Connection)) > NetConnection > NetXAConnection > ClientXAConnection (implements java.sql.XAConnection) > ClientPooledConnection (implements java.sql.PooledConnection) > LogicalConnection (implements java.sql.Connection) > > > On the client side, I first need to understand: is derbyclient.jar > supposed to be standalone (meaning it can't depend upon things in > derby.jar like the Monitor and the UUID class). If so, I suppose I > could cut/paste the BasicUUID class into the client packages for use on > the client side (shiver). Alternately we could have a derbyutils.jar > that is shared between client and server (Big Change, not sure if I want > to take that on). Advice here would be most appreciated. > > Thanks, > > David > > Kathey Marsden (JIRA) wrote: > >> [ http://issues.apache.org/jira/browse/DERBY-243?page=all ] >> >> Kathey Marsden updated DERBY-243: >> --------------------------------- >> >> Summary: connection toString should uniquely identify the >> connection (was: connection toString doesn't give enough information) >> Description: The toString() on the Derby connection doesn't print >> unique information. >> for example System.out.println(conn) prints: >> EmbedConnection in the case of derby embedded >> >> It would be great if the toString() method for connections could be >> used to differentiate one connection from another. >> >> >> >> was: >> The toString() on the Derby connection doesn't print unique information. >> for example System.out.println(conn) prints: >> EmbedConnection in the case of derby embedded >> >> >> >> I am not sure if XA Connections and Pooled Connections have the same >> issue. I didn't immediately see an override of the toString() method >> in BrokeredConnection.java like there is for EmbedConnection >> >> >> >>> connection toString should uniquely identify the connection >>> ----------------------------------------------------------- >>> >>> Key: DERBY-243 >>> URL: http://issues.apache.org/jira/browse/DERBY-243 >>> Project: Derby >>> Type: Improvement >>> Components: JDBC >>> Reporter: Kathey Marsden >>> Assignee: David Van Couvering >>> Priority: Trivial >>> Fix For: 10.0.2.1, 10.0.2.0, 10.0.2.2, 10.1.0.0 >> >> >> >>> The toString() on the Derby connection doesn't print unique information. >>> for example System.out.println(conn) prints: >>> EmbedConnection in the case of derby embedded >>> It would be great if the toString() method for connections could be >>> used to differentiate one connection from another. >> >> >> > >