? build.local.properties
? xa-PGObjectFactory-fix-2.patch
? xa-PGObjectFactory-fix.patch
? xa-endthenjoin-2.diff
? xa-endthenjoin.diff
Index: org/postgresql/xa/PGXADataSource.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/xa/PGXADataSource.java,v
retrieving revision 1.2
diff -c -r1.2 PGXADataSource.java
*** org/postgresql/xa/PGXADataSource.java	29 Oct 2005 18:59:39 -0000	1.2
--- org/postgresql/xa/PGXADataSource.java	26 Feb 2007 18:24:52 -0000
***************
*** 4,9 ****
--- 4,10 ----
  import java.sql.SQLException;
  
  import javax.naming.Referenceable;
+ import javax.naming.Reference;
  import javax.sql.XAConnection;
  import javax.sql.XADataSource;
  
***************
*** 50,53 ****
--- 51,64 ----
      public String getDescription() {
          return "JDBC3 XA-enabled DataSource from " + org.postgresql.Driver.getVersion();
      }
+ 
+     /**
+      * Generates a reference using the appropriate object factory.
+      */
+     protected Reference createReference() {
+         return new Reference(
+                    getClass().getName(),
+                    PGXADataSourceFactory.class.getName(),
+                    null);
+     }
  }
Index: org/postgresql/xa/PGXADataSourceFactory.java
===================================================================
RCS file: org/postgresql/xa/PGXADataSourceFactory.java
diff -N org/postgresql/xa/PGXADataSourceFactory.java
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- org/postgresql/xa/PGXADataSourceFactory.java	26 Feb 2007 18:24:53 -0000
***************
*** 0 ****
--- 1,47 ----
+ /*-------------------------------------------------------------------------
+ *
+ * Copyright (c) 2007, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ *   $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+ package org.postgresql.xa;
+ 
+ import org.postgresql.ds.common.*;
+ 
+ import javax.naming.*;
+ import java.util.Hashtable;
+ 
+ /**
+  * An ObjectFactory implementation for PGXADataSource-objects. 
+  */
+ 
+ public class PGXADataSourceFactory extends PGObjectFactory
+ {
+     /* All the other PostgreSQL DataSource use PGObjectFactory directly, but we
+      * can't do that with PGXADataSource because referencing PGXADataSource
+      * from PGObjectFactory would break "JDBC2 Enterprise" edition build which
+      * doesn't include PGXADataSource.
+      */
+ 
+     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
+                                     Hashtable environment) throws Exception
+     {
+         Reference ref = (Reference)obj;
+         String className = ref.getClassName();
+         if (className.equals("org.postgresql.xa.PGXADataSource"))
+         {
+             return loadXADataSource(ref);
+         }
+ 	else 
+ 	    return null;
+     }
+ 
+     private Object loadXADataSource(Reference ref)
+     {
+         PGXADataSource ds = new PGXADataSource();
+         return loadBaseDataSource(ds, ref);
+     }
+ }
