2
* Redistribution and use of this software and associated documentation
3
* ("Software"), with or without modification, are permitted provided
4
* that the following conditions are met:
6
* 1. Redistributions of source code must retain copyright
7
* statements and notices. Redistributions must also contain a
8
* copy of this document.
10
* 2. Redistributions in binary form must reproduce the
11
* above copyright notice, this list of conditions and the
12
* following disclaimer in the documentation and/or other
13
* materials provided with the distribution.
15
* 3. The name "Exolab" must not be used to endorse or promote
16
* products derived from this Software without prior written
17
* permission of Exoffice Technologies. For written permission,
18
* please contact info@exolab.org.
20
* 4. Products derived from this Software may not be called "Exolab"
21
* nor may "Exolab" appear in their names without prior written
22
* permission of Exoffice Technologies. Exolab is a registered
23
* trademark of Exoffice Technologies.
25
* 5. Due credit should be given to the Exolab Project
26
* (http://www.exolab.org/).
28
* THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
29
* ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
32
* EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39
* OF THE POSSIBILITY OF SUCH DAMAGE.
41
* Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
43
* $Id: TxConnection.java,v 1.3 2001/11/19 22:33:39 momjian Exp $
47
package org.postgresql.xa;
50
import java.sql.Connection;
51
import javax.transaction.xa.Xid;
55
* Describes an open connection associated with a transaction. When a
56
* transaction is opened for a connection, this record is created for
57
* the connection. It indicates the underlying JDBC connection and
58
* transaction Xid. Multiple XA connection that fall under the same
59
* transaction Xid will share the same TxConnection object.
62
* @author <a href="arkin@exoffice.com">Assaf Arkin</a>
65
* @see XAConnectionImpl
67
final class TxConnection
72
* The Xid of the transactions. Connections that are not
73
* associated with a transaction are not represented here.
79
* Holds the underlying JDBC connection for as long as this
80
* connection is useable. If the connection has been rolled back,
81
* timed out or had any other error, this variable will null
82
* and the connection is considered failed.
89
* Indicates the clock time (in ms) when the transaction should
90
* time out. The transaction times out when
91
* <tt>System.currentTimeMillis() > timeout</tt>.
97
* Indicates the clock time (in ms) when the transaction started.
103
* Reference counter indicates how many XA connections share this
104
* underlying connection and transaction. Always one or more.
110
* True if the transaction has failed due to time out.
116
* True if the transaction has already been prepared.
122
* True if the transaction has been prepared and found out to be
123
* read-only. Read-only transactions do not require commit/rollback.