Index: ReleaseNote
===================================================================
RCS file: /cvsroot/omniORBpy/ReleaseNote,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -u -u -r1.12.2.2 -r1.12.2.3
--- ReleaseNote	2000/10/02 16:39:08	1.12.2.2
+++ ReleaseNote	2001/02/20 10:39:34	1.12.2.3
@@ -1,29 +1,16 @@
-Release Notes for omniORBpy 1.2  (2 October 2000)
+Release Notes for omniORBpy 1.3  (20 February 2001)
 ===============================
 
-This is omniORBpy 1.2, a robust high-performance CORBA ORB for Python.
+This is omniORBpy 1.3, a robust high-performance CORBA ORB for Python.
 
 The bindings adhere to the standard IDL to Python mapping which you
 may find at http://cgi.omg.org/cgi-bin/doc?ptc/00-04-08.
 
-
-----------------------------------------------------------------------
-                               WARNING!
-
-The mapping for server-side skeletons has changed since pre-release 2.
-Server-side code written for omniORBpy before pre-release 3 MUST be
-updated to work with omniORBpy 1.0 and above.
-
-This unfortunate state of affairs is due to an internal contradiction
-in drafts of the Python mapping. See below for full details.
-
-----------------------------------------------------------------------
-
-
 omniORBpy makes use of the C++ omniORB library. It can use either
 omniORB 3.0 or omniORB 2.8. If you use omniORB 3.0, the full POA
 functionality is available; with omniORB 2.8 many POA functions are
-not supported.
+not supported. Using omniORBpy with omniORB 2.8 is no longer actively
+supported.
 
 omniORBpy is currently available for many Unix platforms and Windows.
 It has been ported to a number of other operating systems by outside
@@ -34,11 +21,20 @@
     http://www.uk.research.att.com/omniORB/intouch.html
 
 
-Please report any bugs you find to the mailing list, or directly to
-Duncan Grisby,
-                                         dgrisby@uk.research.att.com
+Please report any bugs you find to the mailing list.
 
 
+Summary of changes from omniORBpy 1.2
+-------------------------------------
+
+- Bug fixes. For details, see:
+
+    http://www.uk.research.att.com/omniORB/omniORBpy/bugfixes.html
+
+- Expose the omniORB.maxTcpConnectonPerServer setting to Python.
+
+
+
 Summary of changes from omniORBpy 1.1
 -------------------------------------
 
@@ -74,6 +70,20 @@
 
 Summary of changes from pre-release 2
 -------------------------------------
+
+
+----------------------------------------------------------------------
+                               WARNING!
+
+The mapping for server-side skeletons has changed since pre-release 2.
+Server-side code written for omniORBpy before pre-release 3 MUST be
+updated to work with omniORBpy 1.0 and above.
+
+This unfortunate state of affairs is due to an internal contradiction
+in drafts of the Python mapping.
+
+----------------------------------------------------------------------
+
 
 - Skeleton package names have changed
 
Index: bugfixes.xml
===================================================================
RCS file: /cvsroot/omniORBpy/bugfixes.xml,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.22
diff -u -u -r1.1.2.12 -r1.1.2.22
--- bugfixes.xml	2000/10/02 16:39:06	1.1.2.12
+++ bugfixes.xml	2001/02/20 10:39:33	1.1.2.22
@@ -1,4 +1,4 @@
-<?xml version="1.0" standalone="yes"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
 <?xml-stylesheet type="text/xsl" href="bugfixes.xsl"?>
 
 <!-- The following bugs have been fixed since the omniORBpy 1.2     -->
@@ -6,7 +6,8 @@
 
 <!-- Editors: make sure the content you add is well-formed XML.     -->
 
-<buglist>
+<buglist version="1.3">
 
+<nobugs/>
 
 </buglist>
Index: bugfixes.xsl
===================================================================
RCS file: /cvsroot/omniORBpy/bugfixes.xsl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.8
diff -u -u -r1.1.2.6 -r1.1.2.8
--- bugfixes.xsl	2000/10/02 16:39:07	1.1.2.6
+++ bugfixes.xsl	2001/02/20 10:39:33	1.1.2.8
@@ -1,12 +1,16 @@
 <?xml version="1.0"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html"/>
 
 <!-- This style sheet formats buglist.xml for inclusion on the omniORB -->
 <!-- web pages. The html output assumes that it lives at               -->
 <!-- http://www.uk.research.att.com/omniORB/omniORBpy/bugfixes.html.   -->
 
-
 <xsl:template match="/">
+    <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="buglist">
   <html>
   <head>
   <title>omniORBpy bugs</title>
@@ -19,7 +23,7 @@
   <tr>
     <td width="15%"><img src="omniORBpylogo.gif"/></td>
     <td align="center" bgcolor="#000000"><h1 class="banner">
-        <font color="#FFFFFF"><em>omniORBpy 1.2 Bug List</em></font></h1>
+        <font color="#FFFFFF"><em>omniORBpy <xsl:value-of select="@version"/> Bug List</em></font></h1>
     </td>
 
     <td width="15%"><p align="center">
@@ -70,8 +74,9 @@
         <tr><td>
 
 	  <p>
-	  The following bugs in omniORBpy 1.2 have been fixed. You can
-	  get the fixes in three ways:</p>
+	  The following bugs in omniORBpy <xsl:value-of
+	  select="@version"/> have been fixed. You can get the fixes
+	  in three ways:</p>
 
           <ul><li>Update from <a href="../cvs.html">CVS</a> in the
                   <code>"omnipy1_develop"</code> branch.</li>
@@ -87,9 +92,11 @@
           <p>
           The bugs pages for earlier versions can be found here:
           <ul> 
+              <li><a href="bugfixes12.html">omniORBpy 1.2</a></li>
               <li><a href="bugfixes11.html">omniORBpy 1.1</a></li>
               <li><a href="bugfixes10.html">omniORBpy 1.0</a></li>
           </ul>
+
           </p>
 
           <table align="center" width="95%">
@@ -119,8 +126,10 @@
   </html>
 </xsl:template>
 
-<xsl:template match="buglist">
-    <xsl:apply-templates/>
+<xsl:template match="nobugs">
+
+    <tr><td>No bugs yet.</td></tr>
+
 </xsl:template>
 
 
Index: bugfixes10.xml
===================================================================
RCS file: /cvsroot/omniORBpy/bugfixes10.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.1 -r1.1.2.2
--- bugfixes10.xml	2000/10/02 16:39:07	1.1.2.1
+++ bugfixes10.xml	2000/10/05 11:20:11	1.1.2.2
@@ -1,4 +1,4 @@
-<?xml version="1.0" standalone="yes"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
 <?xml-stylesheet type="text/xsl" href="bugfixes.xsl"?>
 
 <!-- The following bugs have been fixed since the omniORBpy 1.0     -->
@@ -6,7 +6,7 @@
 
 <!-- Editors: make sure the content you add is well-formed XML.     -->
 
-<buglist>
+<buglist version="1.0">
 
 <bug id="4" date="Wed Jul 26 17:01:36 BST 2000" user="dpg1">
 
Index: bugfixes11.xml
===================================================================
RCS file: /cvsroot/omniORBpy/bugfixes11.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.1 -r1.1.2.2
--- bugfixes11.xml	2000/10/02 16:39:07	1.1.2.1
+++ bugfixes11.xml	2000/10/05 11:20:12	1.1.2.2
@@ -1,4 +1,4 @@
-<?xml version="1.0" standalone="yes"?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
 <?xml-stylesheet type="text/xsl" href="bugfixes.xsl"?>
 
 <!-- The following bugs have been fixed since the omniORBpy 1.0     -->
@@ -6,7 +6,7 @@
 
 <!-- Editors: make sure the content you add is well-formed XML.     -->
 
-<buglist>
+<buglist version="1.2">
 
 <bug id="7" date="Thu Sep 21 14:14:30 BST 2000" user="dpg1">
 
Index: update.log
===================================================================
RCS file: /cvsroot/omniORBpy/update.log,v
retrieving revision 1.28.2.34
retrieving revision 1.28.2.47
diff -u -u -r1.28.2.34 -r1.28.2.47
--- update.log	2000/10/02 16:39:07	1.28.2.34
+++ update.log	2001/02/20 10:39:33	1.28.2.47
@@ -1,3 +1,130 @@
+Tue Feb 20 10:34:35 GMT 2001 dpg1
+=================================
+
+- Updates for 1.3 release.
+
+src/lib/omniORBpy/bugfixes.xml
+src/lib/omniORBpy/bugfixes.xsl
+src/lib/omniORBpy/bugfixes12.xml                          -- new
+src/lib/omniORBpy/update.log
+src/lib/omniORBpy/doc/tex/omniORBpy.tex
+src/lib/omniORBpy/external_merge/ReleaseNote
+src/lib/omniORBpy/external_merge/THIS_IS_OMNIORBPY_1_2    -- deleted
+src/lib/omniORBpy/external_merge/THIS_IS_OMNIORBPY_1_3    -- new
+src/lib/omniORBpy/external_merge/doc/omniORBpy.pdf
+src/lib/omniORBpy/external_merge/doc/omniORBpy.ps
+src/lib/omniORBpy/external_merge/doc/omniORBpy/index.html
+src/lib/omniORBpy/external_merge/doc/omniORBpy/omniORBpy007.html
+src/lib/omniORBpy/modules/dir.mk
+
+
+Wed Feb 14 15:10:33 GMT 2001 dpg1
+=================================
+
+- Fix bug using repoId strings after deletion.
+
+modules/omni30/omnipy30.h
+modules/omni30/pyObjectRef.cc
+modules/omni30/pyPOAFunc.cc
+modules/omni30/pyServant.cc
+
+
+Thu Jan 18 11:45:43 GMT 2001 dpg1
+=================================
+
+- Silly bug with marshalling TypeCode for CORBA::Object.
+
+modules/common/pyTypeCode.cc
+
+
+Mon Dec  4 17:56:07 GMT 2000 dpg1
+=================================
+
+- Fix bug with TypeCode indirections.
+
+modules/common/pyTypeCode.cc
+
+
+Wed Nov 29 17:01:06 GMT 2000 dpg1
+=================================
+
+- Fix deadlock when trying to lock omniORB internal lock while holding
+  the Python interpreter lock. Must be allowed to lock Python lock
+  while holding omniORB lock to avoid the race condition with
+  _release_ref() on Python servants.
+
+modules/omni30/omnipy30.h
+modules/omni30/pyORBFunc.cc
+modules/omni30/pyObjectRef.cc
+modules/omni30/pyPOAFunc.cc
+modules/omni30/pyPOAManagerFunc.cc
+modules/omni30/pyServant.cc
+
+
+Tue Nov 28 14:48:48 GMT 2000 dpg1
+=================================
+
+- Typo in method name.
+
+python/omniORB/PortableServer.py
+
+
+Mon Nov 27 11:06:48 GMT 2000 dpg1
+=================================
+
+- Some references to python changed to $(PYTHON)
+
+src/lib/omniORBpy/modules/dir.mk
+
+
+Tue Nov 21 14:21:03 GMT 2000 dpg1
+=================================
+
+- resolve_initial_references has the same bug as string_to_object
+
+src/lib/omniORBpy/modules/omni30/pyORBFunc.cc
+
+
+Tue Nov 21 10:46:54 GMT 2000 dpg1
+=================================
+
+- Segfault when string_to_object returns a nil objref
+
+src/lib/omniORBpy/modules/omni30/pyObjectRef.cc
+
+
+Thu Nov  2 17:41:22 GMT 2000p dpg1
+=================================
+
+- Unnecessary extra call to _is_a() after narrow()
+
+modules/omni30/omnipy.cc
+
+
+Wed Nov  1 11:21:45 GMT 2000 dpg1
+=================================
+
+- Recursive structs inside interfaces were broken
+
+omniidl_be/python.py
+
+
+Mon Oct 30 14:24:17 GMT 2000 dpg1
+=================================
+
+- Add omniORB.maxTcpConnectionPerServer
+
+src/lib/omniORBpy/modules/common/pyomniFunc.cc
+
+
+Mon Oct  9 09:54:53 BST 2000 dpg1
+=================================
+
+- pyThreadCache active flag is now a reference count
+
+modules/common/pyThreadCache.h
+
+
 Mon Oct  2 17:35:57 BST 2000 dpg1
 =================================
 
Index: doc/omniORBpy/index.html
===================================================================
RCS file: /cvsroot/omniORBpy/doc/omniORBpy/index.html,v
retrieving revision 1.2.2.4
retrieving revision 1.2.2.5
diff -u -u -r1.2.2.4 -r1.2.2.5
--- doc/omniORBpy/index.html	2000/10/02 16:39:11	1.2.2.4
+++ doc/omniORBpy/index.html	2001/02/20 10:39:37	1.2.2.5
@@ -15,7 +15,7 @@
 <BR>
 <DIV ALIGN=center><BR>
 <BR>
- <FONT SIZE=7>The omniORBpy version 1.2<BR>User's Guide
+ <FONT SIZE=7>The omniORBpy version 1.3<BR>User's Guide
 </FONT><BR>
 <BR>
  <FONT SIZE=5>Duncan Grisby<BR></FONT><FONT SIZE=3>(</FONT><FONT SIZE=3><I>email: </I></FONT><A HREF="mailto:dgrisby@uk.research.att.com"><FONT SIZE=3><I>dgrisby@uk.research.att.com</I></FONT></A><FONT SIZE=3>)</FONT><FONT SIZE=5><BR>AT&amp;T Laboratories Cambridge<BR></FONT><BR>
@@ -25,13 +25,17 @@
 <FONT SIZE=5><B>Changes and Additions, August 2000</B></FONT>
 <UL>
 <LI>
+ New <TT>omniORB.maxTcpConnectionPerServer</TT> function.
+</UL><FONT SIZE=5><B>Changes and Additions, August 2000</B></FONT>
+<UL>
+<LI>
  New <TT>omniORB.LOCATION_FORWARD</TT> exception.
 
-<LI> New <TT>omniORB.traceLevel()</TT> function
+<LI> New <TT>omniORB.traceLevel()</TT> function.
 </UL><FONT SIZE=5><B>Changes and Additions, June 2000</B></FONT>
 <UL>
 <LI>
- Brand new manual
+ Brand new manual.
 </UL><FONT SIZE=5><B>Contents</B></FONT>
 <BR>
 <BR>
Index: doc/omniORBpy/omniORBpy007.html
===================================================================
RCS file: /cvsroot/omniORBpy/doc/omniORBpy/omniORBpy007.html,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -u -r1.2.2.2 -r1.2.2.3
--- doc/omniORBpy/omniORBpy007.html	2000/09/19 11:28:10	1.2.2.2
+++ doc/omniORBpy/omniORBpy007.html	2001/02/20 10:39:37	1.2.2.3
@@ -78,7 +78,10 @@
 Therefore, there may be one or more object references in one address
 space that refer to objects in a different address space but unless
 the application invokes on these objects, no network connection is
-made.<BR>
+made. The maximum number of connections opened to another address
+space is 5 by default. This parameter can be changed by calling the
+<TT>omniORB.maxTcpConnectionPerServer</TT> function <EM>before</EM>
+calling <TT>ORB_init()</TT>.<BR>
 <BR>
 It is wasteful to leave a connection open when it has been left unused
 for a considerable time. Too many idle connections could block out new
Index: doc/tex/omniORBpy.tex
===================================================================
RCS file: /cvsroot/omniORBpy/doc/tex/omniORBpy.tex,v
retrieving revision 1.2.2.4
retrieving revision 1.2.2.5
diff -u -u -r1.2.2.4 -r1.2.2.5
--- doc/tex/omniORBpy.tex	2000/10/02 16:39:07	1.2.2.4
+++ doc/tex/omniORBpy.tex	2001/02/20 10:39:33	1.2.2.5
@@ -157,7 +157,7 @@
 \vfill
 
 { \Huge
-The omniORBpy version 1.2\\[4mm]
+The omniORBpy version 1.3\\[4mm]
 User's Guide
 }
 
@@ -184,15 +184,22 @@
 
 {\Large \bf Changes and Additions, August 2000}
 \begin{itemize}
+\item New \code{omniORB.maxTcpConnectionPerServer} function.
+\end{itemize}
+
+\vspace{\baselineskip}
+
+{\Large \bf Changes and Additions, August 2000}
+\begin{itemize}
 \item New \code{omniORB.LOCATION\_FORWARD} exception.
-\item New \op{omniORB.traceLevel} function
+\item New \op{omniORB.traceLevel} function.
 \end{itemize}
 
 \vspace{\baselineskip}
 
 {\Large \bf Changes and Additions, June 2000}
 \begin{itemize}
-\item Brand new manual
+\item Brand new manual.
 \end{itemize}
 
 
@@ -2822,7 +2829,10 @@
 Therefore, there may be one or more object references in one address
 space that refer to objects in a different address space but unless
 the application invokes on these objects, no network connection is
-made.
+made. The maximum number of connections opened to another address
+space is 5 by default. This parameter can be changed by calling the
+\code{omniORB.\dsc{}maxTcpConnectionPerServer} function \emph{before}
+calling \op{ORB\_init}.
 
 It is wasteful to leave a connection open when it has been left unused
 for a considerable time. Too many idle connections could block out new
Index: modules/dir.mk
===================================================================
RCS file: /cvsroot/omniORBpy/modules/dir.mk,v
retrieving revision 1.27.2.6
retrieving revision 1.27.2.8
diff -u -u -r1.27.2.6 -r1.27.2.8
--- modules/dir.mk	2000/09/28 09:23:10	1.27.2.6
+++ modules/dir.mk	2001/02/20 10:39:37	1.27.2.8
@@ -81,7 +81,7 @@
 ifdef UnixPlatform
 #CXXDEBUGFLAGS = -g
 
-PYPREFIX  := $(shell python -c 'import sys; print sys.exec_prefix')
+PYPREFIX  := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')
 PYVERSION := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
 PYINCDIR  := $(PYPREFIX)/include
 PYINCFILE := "<python$(PYVERSION)/Python.h>"
@@ -192,7 +192,7 @@
 
 ifdef Win32Platform
 
-PYPREFIX1 := "$(shell python -c 'import sys,string; sys.stdout.write(string.lower(sys.prefix))')"
+PYPREFIX1 := "$(shell $(PYTHON) -c 'import sys,string; sys.stdout.write(string.lower(sys.prefix))')"
 PYPREFIX  := $(subst program files,progra~1,$(subst \,/,$(PYPREFIX1)))
 PYVERSION := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.version[:3])')
 PYINCDIR  := $(PYPREFIX)/include
@@ -335,7 +335,7 @@
 
 ifdef NextStep
 
-PYPREFIX = $(shell python -c "import sys;print sys.exec_prefix")
+PYPREFIX = $(shell $(PYTHON) -c "import sys;print sys.exec_prefix")
 CXXOPTIONS += -I$(PYPREFIX)/include
 CXXLINKOPTIONS += -nostdlib -r
 SO = .so
@@ -436,6 +436,44 @@
         )
 
 all:: $(lib)
+
+clean::
+	$(RM) $(lib)
+
+export:: $(lib)
+	@$(ExportLibrary)
+	@(set -x; \
+          cd $(EXPORT_TREE)/$(LIBDIR); \
+          $(RM) $(soname); \
+          ln -s $(lib) $(soname); \
+          $(RM) $(libname); \
+          ln -s $(soname) $(libname); \
+         )
+
+endif
+endif
+
+
+#############################################################################
+#   Make rules for Digital Unix                                             #
+#############################################################################
+
+ifdef OSF1
+ifeq ($(notdir $(CXX)),cxx)
+
+libname = _omnipymodule.so
+soname  = $(libname).$(OMNIPY_MAJOR)
+lib     = $(soname).$(OMNIPY_MINOR)
+
+all:: $(lib)
+
+$(lib): $(OBJS)
+	(set -x; \
+         $(RM) $@; \
+         ld -shared -soname $(soname) -set_version $(soname) -o $@ $(IMPORT_LIBRARY_FLAGS) \
+         $(filter-out $(LibSuffixPattern),$^) $(OMNIORB_LIB_NODYN) -lcxxstd -lcxx -lexc -lots -lc \
+        )
+
 
 clean::
 	$(RM) $(lib)
Index: modules/common/pyThreadCache.h
===================================================================
RCS file: /cvsroot/omniORBpy/modules/common/pyThreadCache.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.1 -r1.1.2.2
--- modules/common/pyThreadCache.h	2000/09/27 15:57:21	1.1.2.1
+++ modules/common/pyThreadCache.h	2000/10/09 09:38:04	1.1.2.2
@@ -28,9 +28,12 @@
 //    Cached mapping from threads to PyThreadState and
 //    threading.Thread objects
 
-// $Id: pyThreadCache.h,v 1.1.2.1 2000/09/27 15:57:21 dpg1 Exp $
+// $Id: pyThreadCache.h,v 1.1.2.2 2000/10/09 09:38:04 dpg1 Exp $
 
 // $Log: pyThreadCache.h,v $
+// Revision 1.1.2.2  2000/10/09 09:38:04  dpg1
+// pyThreadCache active flag is now a reference count
+//
 // Revision 1.1.2.1  2000/09/27 15:57:21  dpg1
 // #include<python1.5/pythread.h> generalised for other Python versions
 //
@@ -60,7 +63,7 @@
     PyObject*      workerThread;
 
     CORBA::Boolean used;
-    CORBA::Boolean active;
+    int            active;
 
     CacheNode*     next;
     CacheNode**    back;
@@ -105,16 +108,16 @@
       while (cn && cn->id != id) cn = cn->next;
       if (!cn) cn = addNewNode(id, hash);
 
-      cn->used   = 1;
-      cn->active = 1;
+      cn->used = 1;
+      cn->active++;
     }
     return cn;
   }
 
   static inline void releaseNode(CacheNode* cn) {
     omni_mutex_lock _l(*guard);
-    cn->used   = 1;
-    cn->active = 0;
+    cn->used = 1;
+    cn->active--;
   }
 
   static CacheNode* addNewNode(long id, unsigned int hash);
Index: modules/common/pyTypeCode.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/common/pyTypeCode.cc,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.4
diff -u -u -r1.11.2.2 -r1.11.2.4
--- modules/common/pyTypeCode.cc	2000/08/17 08:44:09	1.11.2.2
+++ modules/common/pyTypeCode.cc	2001/01/18 11:52:06	1.11.2.4
@@ -27,10 +27,15 @@
 // Description:
 //    TypeCode support
 
+// $Id: pyTypeCode.cc,v 1.11.2.4 2001/01/18 11:52:06 dpg1 Exp $
 
-// $Id: pyTypeCode.cc,v 1.11.2.2 2000/08/17 08:44:09 dpg1 Exp $
-
 // $Log: pyTypeCode.cc,v $
+// Revision 1.11.2.4  2001/01/18 11:52:06  dpg1
+// Silly bug with marshalling TypeCode for CORBA::Object.
+//
+// Revision 1.11.2.3  2000/12/04 18:04:42  dpg1
+// Fix bug with TypeCode indirections.
+//
 // Revision 1.11.2.2  2000/08/17 08:44:09  dpg1
 // Updates for long long were broken on platforms without it
 //
@@ -524,10 +529,8 @@
 #define MARSHAL_PYSTRING(_stream, _pystring) { \
   CORBA::ULong _slen = PyString_GET_SIZE(_pystring) + 1; \
   _slen >>= _stream; \
-  if (_slen > 1) { \
-    char* _str = PyString_AS_STRING(_pystring); \
-    _stream.put_char_array((const CORBA::Char*)((const char*)_str), _slen); \
-  } \
+  char* _str = PyString_AS_STRING(_pystring); \
+  _stream.put_char_array((const CORBA::Char*)((const char*)_str), _slen); \
 }
 
 void
@@ -543,12 +546,12 @@
   if (omniORB::useTypeCodeIndirections && dom.lookup(d_o, tc_offset)) {
 
     CORBA::ULong tk_ind = 0xffffffff;
-    CORBA::Long  offset = tc_offset - stream.WrMessageAlreadyWritten();
-
     tk_ind >>= stream;
+
+    CORBA::Long  offset = tc_offset - stream.WrMessageAlreadyWritten();
     offset >>= stream;
 
-    //    cout << "indirection to " << offset << endl;
+    //    cout << "indirection to " << offset << ", " << tc_offset << endl;
   }
   else {
     CORBA::ULong   tk;
@@ -939,12 +942,12 @@
   if (omniORB::useTypeCodeIndirections && dom.lookup(d_o, tc_offset)) {
 
     CORBA::ULong tk_ind = 0xffffffff;
-    CORBA::Long  offset = tc_offset - stream.WrMessageAlreadyWritten();
-
     tk_ind >>= stream;
+
+    CORBA::Long  offset = tc_offset - stream.WrMessageAlreadyWritten();
     offset >>= stream;
 
-    //    cout << "indirection to " << offset << endl;
+    //    cout << "indirection to " << offset << ", " << tc_offset << endl;
   }
   else {
     CORBA::ULong   tk;
@@ -1418,7 +1421,23 @@
 	// Static knowledge of the structure
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	// We could unmarshal the whole TypeCode and check it for
+	// equivalence, but we don't bother. We still have to recurse
+	// into the TypeCode in case there are later indirections into
+	// it.
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // Name
+	CORBA::ULong cnt; cnt <<= encap;
+
+	for (CORBA::ULong i=0; i < cnt; i++) {
+	  // Member name and type
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
       }
       else {
 	// Don't know this structure
@@ -1458,7 +1477,7 @@
 
 	// Create class object:
 	// *** Could be made faster by finding the createUnknownStruct
-	// function only once, and manually building the argument typle
+	// function only once, and manually building the argument tuple
 	t_o = PyObject_GetAttrString(omniPy::pyomniORBmodule,
 				     (char*)"createUnknownStruct");
 	OMNIORB_ASSERT(t_o && PyFunction_Check(t_o));
@@ -1490,7 +1509,32 @@
 	// Static knowledge of the union
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	// We could unmarshal the whole TypeCode and check it for
+	// equivalence, but we don't bother. We still have to recurse
+	// into the TypeCode in case there are later indirections into
+	// it.
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // Name
+	PyObject* discriminant = r_unmarshalTypeCode(encap, eodm);
+
+	CORBA::Long  def_used; def_used <<= encap;
+	CORBA::ULong cnt;      cnt      <<= encap;
+
+	for (CORBA::ULong i=0; i<cnt; i++) {
+	  // Label value
+	  t_o = omniPy::unmarshalPyObject(encap, discriminant); Py_DECREF(t_o);
+
+	  // Member name
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+
+	  // Member type
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
+	Py_DECREF(discriminant);
       }
       else {
 	// Don't know this union
@@ -1698,6 +1742,11 @@
 	// Static knowledge of the alias
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // name
+	t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
       }
       else {
 	OffsetDescriptorMap eodm(odm, tc_offset + 8);
@@ -1706,7 +1755,7 @@
 	PyTuple_SET_ITEM(d_o, 0, PyInt_FromLong(tk));
 	PyTuple_SET_ITEM(d_o, 1, repoId);
 
-	// repoId and name
+	// name
 	UNMARSHAL_PYSTRING(encap, t_o); PyTuple_SET_ITEM(d_o, 2, t_o);
 
 	// TypeCode
@@ -1733,7 +1782,18 @@
 	// Static knowledge of the exception
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // name
+	CORBA::ULong cnt; cnt <<= encap;
+
+	for (CORBA::ULong i=0; i < cnt; i++) {
+	  // Member name and type
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
       }
       else {
 	// Don't know this exception
@@ -1772,8 +1832,8 @@
 	}
 
 	// Create class object:
-	// *** Could be made faster by finding the createUnknownStruct
-	// function only once, and manually building the argument typle
+	// *** Could be made faster by finding the createUnknownUserException
+	// function only once, and manually building the argument tuple
 	t_o = PyObject_GetAttrString(omniPy::pyomniORBmodule,
 				     (char*)"createUnknownUserException");
 	OMNIORB_ASSERT(t_o && PyFunction_Check(t_o));
@@ -1791,7 +1851,7 @@
   case 0xffffffff:
     {
       //      cout << "indirect" << endl;
-      CORBA::ULong position, offset;
+      CORBA::Long position, offset;
 
       offset  <<= stream;
       position  = tc_offset + 4 + offset;
@@ -1904,7 +1964,23 @@
 	// Static knowledge of the structure
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	// We could unmarshal the whole TypeCode and check it for
+	// equivalence, but we don't bother. We still have to recurse
+	// into the TypeCode in case there are later indirections into
+	// it.
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // Name
+	CORBA::ULong cnt; cnt <<= encap;
+
+	for (CORBA::ULong i=0; i < cnt; i++) {
+	  // Member name and type
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
       }
       else {
 	// Don't know this structure
@@ -1944,7 +2020,7 @@
 
 	// Create class object:
 	// *** Could be made faster by finding the createUnknownStruct
-	// function only once, and manually building the argument typle
+	// function only once, and manually building the argument tuple
 	t_o = PyObject_GetAttrString(omniPy::pyomniORBmodule,
 				     (char*)"createUnknownStruct");
 	OMNIORB_ASSERT(t_o && PyFunction_Check(t_o));
@@ -1976,7 +2052,32 @@
 	// Static knowledge of the union
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	// We could unmarshal the whole TypeCode and check it for
+	// equivalence, but we don't bother. We still have to recurse
+	// into the TypeCode in case there are later indirections into
+	// it.
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // Name
+	PyObject* discriminant = r_unmarshalTypeCode(encap, eodm);
+
+	CORBA::Long  def_used; def_used <<= encap;
+	CORBA::ULong cnt;      cnt      <<= encap;
+
+	for (CORBA::ULong i=0; i<cnt; i++) {
+	  // Label value
+	  t_o = omniPy::unmarshalPyObject(encap, discriminant); Py_DECREF(t_o);
+
+	  // Member name
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+
+	  // Member type
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
+	Py_DECREF(discriminant);
       }
       else {
 	// Don't know this union
@@ -2184,6 +2285,11 @@
 	// Static knowledge of the alias
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // name
+	t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
       }
       else {
 	OffsetDescriptorMap eodm(odm, tc_offset + 8);
@@ -2192,7 +2298,7 @@
 	PyTuple_SET_ITEM(d_o, 0, PyInt_FromLong(tk));
 	PyTuple_SET_ITEM(d_o, 1, repoId);
 
-	// repoId and name
+	// name
 	UNMARSHAL_PYSTRING(encap, t_o); PyTuple_SET_ITEM(d_o, 2, t_o);
 
 	// TypeCode
@@ -2219,7 +2325,18 @@
 	// Static knowledge of the exception
 	Py_INCREF(d_o);
 	Py_DECREF(repoId);
-	//?? Is is worth checking the TypeCodes for equivalence?
+
+	odm.add(d_o, tc_offset);
+	OffsetDescriptorMap eodm(odm, tc_offset + 8);
+
+	UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o); // name
+	CORBA::ULong cnt; cnt <<= encap;
+
+	for (CORBA::ULong i=0; i < cnt; i++) {
+	  // Member name and type
+	  UNMARSHAL_PYSTRING(encap, t_o); Py_DECREF(t_o);
+	  t_o = r_unmarshalTypeCode(encap, eodm); Py_DECREF(t_o);
+	}
       }
       else {
 	// Don't know this exception
@@ -2258,8 +2375,8 @@
 	}
 
 	// Create class object:
-	// *** Could be made faster by finding the createUnknownStruct
-	// function only once, and manually building the argument typle
+	// *** Could be made faster by finding the createUnknownUserException
+	// function only once, and manually building the argument tuple
 	t_o = PyObject_GetAttrString(omniPy::pyomniORBmodule,
 				     (char*)"createUnknownUserException");
 	OMNIORB_ASSERT(t_o && PyFunction_Check(t_o));
@@ -2277,7 +2394,7 @@
   case 0xffffffff:
     {
       //      cout << "indirect" << endl;
-      CORBA::ULong position, offset;
+      CORBA::Long position, offset;
 
       offset  <<= stream;
       position  = tc_offset + 4 + offset;
Index: modules/common/pyomniFunc.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/common/pyomniFunc.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -u -r1.1.2.3 -r1.1.2.4
--- modules/common/pyomniFunc.cc	2000/09/19 09:24:16	1.1.2.3
+++ modules/common/pyomniFunc.cc	2000/10/30 14:27:36	1.1.2.4
@@ -27,8 +27,11 @@
 // Description:
 //    omniORB API functions
 
-// $Id: pyomniFunc.cc,v 1.1.2.3 2000/09/19 09:24:16 dpg1 Exp $
+// $Id: pyomniFunc.cc,v 1.1.2.4 2000/10/30 14:27:36 dpg1 Exp $
 // $Log: pyomniFunc.cc,v $
+// Revision 1.1.2.4  2000/10/30 14:27:36  dpg1
+// Add omniORB.maxTcpConnectionPerServer
+//
 // Revision 1.1.2.3  2000/09/19 09:24:16  dpg1
 // More paranoid about clearing Python error status
 //
@@ -359,6 +362,37 @@
     return 0;
   }
 
+  static char maxTcpConnectionPerServer_doc [] =
+  "maxTcpConnectionPerServer(int) -> None\n"
+  "maxTcpConnectionPerServer()    -> int\n"
+  "\n"
+  "The ORB opens more than one TCP connection to a server if there\n"
+  "is more than one concurrent invocation to that server. This variable\n"
+  "decides the maximum number of connections to use per server. This\n"
+  "variable is read only once at ORB_init. If the number of concurrent\n"
+  "invocations exceeds this number, the extra invocations are blocked\n"
+  "until the the outstanding ones return. (The default value is 5.)\n";
+
+  static PyObject* pyomni_maxTcpConnectionPerServer(PyObject* self,
+						    PyObject* args)
+  {
+    if (PyTuple_GET_SIZE(args) == 0) {
+      return PyInt_FromLong(omniORB::maxTcpConnectionPerServer);
+    }
+    else if (PyTuple_GET_SIZE(args) == 1) {
+      PyObject* pymc = PyTuple_GET_ITEM(args, 0);
+
+      if (PyInt_Check(pymc)) {
+	omniORB::maxTcpConnectionPerServer = PyInt_AS_LONG(pymc);
+	Py_INCREF(Py_None);
+	return Py_None;
+      }
+    }
+    PyErr_SetString(PyExc_TypeError,
+		    (char*)"Operation requires a single integer argument");
+    return 0;
+  }
+
   static PyMethodDef pyomni_methods[] = {
     {(char*)"installTransientExceptionHandler",
      pyomni_installTransientExceptionHandler,
@@ -375,6 +409,10 @@
     {(char*)"traceLevel",
      pyomni_traceLevel,
      METH_VARARGS, traceLevel_doc},
+
+    {(char*)"maxTcpConnectionPerServer",
+     pyomni_maxTcpConnectionPerServer,
+     METH_VARARGS, maxTcpConnectionPerServer_doc},
 
     {NULL,NULL}
   };
Index: modules/omni30/omnipy.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/omnipy.cc,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -u -u -r1.37 -r1.37.2.1
--- modules/omni30/omnipy.cc	2000/06/27 15:12:22	1.37
+++ modules/omni30/omnipy.cc	2000/11/02 17:45:42	1.37.2.1
@@ -27,9 +27,12 @@
 // Description:
 //    Main entry points for _omnipy Python module
 
-// $Id: omnipy.cc,v 1.37 2000/06/27 15:12:22 dpg1 Exp $
+// $Id: omnipy.cc,v 1.37.2.1 2000/11/02 17:45:42 dpg1 Exp $
 
 // $Log: omnipy.cc,v $
+// Revision 1.37.2.1  2000/11/02 17:45:42  dpg1
+// Unnecessary extra call to _is_a() after narrow()
+//
 // Revision 1.37  2000/06/27 15:12:22  dpg1
 // Change error message for version clash
 //
@@ -745,7 +748,7 @@
       omniObjRef* oodest = omniPy::createObjRef(oosource->_mostDerivedRepoId(),
 						repoId,
 						oosource->_iopProfiles(),
-						0, 0);
+						0, 1);
       CORBA::Object_ptr cxxdest =
 	(CORBA::Object_ptr)(oodest->_ptrToObjRef(CORBA::Object::_PD_repoId));
 
Index: modules/omni30/omnipy30.h
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/omnipy30.h,v
retrieving revision 1.25.2.2
retrieving revision 1.25.2.4
diff -u -u -r1.25.2.2 -r1.25.2.4
--- modules/omni30/omnipy30.h	2000/09/21 11:05:49	1.25.2.2
+++ modules/omni30/omnipy30.h	2001/02/14 15:22:20	1.25.2.4
@@ -27,9 +27,16 @@
 // Description:
 //    Master header file for omnipy internals, omniORB 3.0 version.
 
-// $Id: omnipy30.h,v 1.25.2.2 2000/09/21 11:05:49 dpg1 Exp $
+// $Id: omnipy30.h,v 1.25.2.4 2001/02/14 15:22:20 dpg1 Exp $
 
 // $Log: omnipy30.h,v $
+// Revision 1.25.2.4  2001/02/14 15:22:20  dpg1
+// Fix bug using repoId strings after deletion.
+//
+// Revision 1.25.2.3  2000/11/29 17:11:18  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
 // Revision 1.25.2.2  2000/09/21 11:05:49  dpg1
 // Fix race condition with Py_omniServant deletion.
 //
@@ -278,7 +285,9 @@
   // Object reference functions                                             //
   ////////////////////////////////////////////////////////////////////////////
 
-  // Create the Python object relating to a CORBA object reference:
+  // Create the Python object relating to a CORBA object reference
+  //
+  // Caller must hold the Python interpreter lock.
   static
   PyObject* createPyCorbaObjRef(const char* targetRepoId,
 				const CORBA::Object_ptr objref);
@@ -289,6 +298,8 @@
 
   // Functions which mirror omni::createObjRef(). These versions don't
   // look for C++ proxy factories, and spot local Python servants.
+  //
+  // Caller must NOT hold the Python interpreter lock.
   static
   omniObjRef* createObjRef(const char*             mostDerivedRepoId,
 			   const char*             targetRepoId,
@@ -309,27 +320,32 @@
   // When a POA creates a reference to a Python servant, it does not
   // have a proxy object factory for it, so it creates an
   // omniAnonObjRef. This function converts one of them into a
-  // Py_omniObjRef with a reference to the local servant. It
-  // decrements the refcount of the original objref.
+  // Py_omniObjRef with a reference to the local servant.
+  //
+  // Caller must NOT hold the Python interpreter lock.
   static
   CORBA::Object_ptr makeLocalObjRef(const char* targetRepoId,
-				    CORBA::Object_ptr objref);
+				    const CORBA::Object_ptr objref);
 
   // Copy a Python object reference in an argument or return value.
   // Compares the type of the objref with the target type, and creates
   // a new objref of the target type if they are not compatible. Sets
   // Python exception status to BAD_PARAM and returns 0 if the Python
   // object is not an object reference.
+  //
+  // Caller must hold the Python interpreter lock.
   static
   PyObject* copyObjRefArgument(PyObject*               pytargetRepoId,
 			       PyObject*               pyobjref,
 			       CORBA::CompletionStatus compstatus);
 
-  // Mirror of omniURI::stringToObject()
+  // Mirror of omniURI::stringToObject(). Caller must hold the Python
+  // interpreter lock.
   static
   CORBA::Object_ptr stringToObject(const char* uri);
 
-  // Mirrors of CORBA::UnMarshalObjRef()
+  // Mirrors of CORBA::UnMarshalObjRef(). Caller must hold the Python
+  // interpreter lock.
   static
   CORBA::Object_ptr UnMarshalObjRef(const char* repoId, NetBufferedStream& s);
 
Index: modules/omni30/pyORBFunc.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/pyORBFunc.cc,v
retrieving revision 1.7
retrieving revision 1.7.2.2
diff -u -u -r1.7 -r1.7.2.2
--- modules/omni30/pyORBFunc.cc	2000/06/02 14:25:51	1.7
+++ modules/omni30/pyORBFunc.cc	2000/11/29 17:11:18	1.7.2.2
@@ -27,9 +27,16 @@
 // Description:
 //    ORB functions
 
-// $Id: pyORBFunc.cc,v 1.7 2000/06/02 14:25:51 dpg1 Exp $
+// $Id: pyORBFunc.cc,v 1.7.2.2 2000/11/29 17:11:18 dpg1 Exp $
 
 // $Log: pyORBFunc.cc,v $
+// Revision 1.7.2.2  2000/11/29 17:11:18  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
+// Revision 1.7.2.1  2000/11/21 14:27:16  dpg1
+// Fix resolve_initial_references.
+//
 // Revision 1.7  2000/06/02 14:25:51  dpg1
 // orb.run() now properly exits when the ORB is shut down
 //
@@ -117,8 +124,11 @@
     }
     RAISE_PY_BAD_PARAM_IF(!objref);
 
-    CORBA::String_var str = orb->object_to_string(objref);
-
+    CORBA::String_var str;
+    {
+      omniPy::InterpreterUnlocker _u;
+      str = orb->object_to_string(objref);
+    }
     return PyString_FromString((char*)str);
   }
 
@@ -133,8 +143,11 @@
     CORBA::ORB_ptr orb = (CORBA::ORB_ptr)omniPy::getTwin(pyorb, ORB_TWIN);
     OMNIORB_ASSERT(orb);
 
-    CORBA::ORB::ObjectIdList_var ids = orb->list_initial_services();
-
+    CORBA::ORB::ObjectIdList_var ids;
+    {
+      omniPy::InterpreterUnlocker _u;
+      ids = orb->list_initial_services();
+    }
     PyObject* pyids = PyList_New(ids->length());
 
     for (CORBA::ULong i=0; i<ids->length(); i++) {
@@ -158,7 +171,19 @@
     CORBA::Object_ptr objref;
 
     try {
+      omniPy::InterpreterUnlocker _u;
       objref = orb->resolve_initial_references(id);
+
+      if (!(CORBA::is_nil(objref) || objref->_NP_is_pseudo())) {
+	omniObjRef* cxxref = objref->_PR_getobj();
+	omniObjRef* pyref  = omniPy::createObjRef(cxxref->_mostDerivedRepoId(),
+						  CORBA::Object::_PD_repoId,
+						  cxxref->_iopProfiles(),
+						  0, 0);
+	CORBA::release(objref);
+	objref =
+	  (CORBA::Object_ptr)pyref->_ptrToObjRef(CORBA::Object::_PD_repoId);
+      }
     }
     catch (CORBA::ORB::InvalidName& ex) {
       PyObject* excc = PyObject_GetAttrString(pyorb, (char*)"InvalidName");
@@ -169,16 +194,6 @@
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
 
-    if (!objref->_NP_is_pseudo()) {
-      omniObjRef* cxxref = objref->_PR_getobj();
-      omniObjRef* pyref  = omniPy::createObjRef(cxxref->_mostDerivedRepoId(),
-						CORBA::Object::_PD_repoId,
-						cxxref->_iopProfiles(),
-						0, 0);
-      CORBA::release(objref);
-      objref =
-	(CORBA::Object_ptr)pyref->_ptrToObjRef(CORBA::Object::_PD_repoId);
-    }
     return omniPy::createPyCorbaObjRef(0, objref);
   }
 
Index: modules/omni30/pyObjectRef.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/pyObjectRef.cc,v
retrieving revision 1.17
retrieving revision 1.17.2.3
diff -u -u -r1.17 -r1.17.2.3
--- modules/omni30/pyObjectRef.cc	2000/06/27 15:13:12	1.17
+++ modules/omni30/pyObjectRef.cc	2001/02/14 15:22:20	1.17.2.3
@@ -28,9 +28,18 @@
 //    Versions of ORB object ref functions which deal with Python
 //    objects, rather than C++ objects
 
-// $Id: pyObjectRef.cc,v 1.17 2000/06/27 15:13:12 dpg1 Exp $
-
+// $Id: pyObjectRef.cc,v 1.17.2.3 2001/02/14 15:22:20 dpg1 Exp $
 // $Log: pyObjectRef.cc,v $
+// Revision 1.17.2.3  2001/02/14 15:22:20  dpg1
+// Fix bug using repoId strings after deletion.
+//
+// Revision 1.17.2.2  2000/11/29 17:11:18  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
+// Revision 1.17.2.1  2000/11/21 10:59:58  dpg1
+// Segfault when string_to_object returns a nil objref.
+//
 // Revision 1.17  2000/06/27 15:13:12  dpg1
 // New copyObjRefArgument() function
 //
@@ -450,7 +459,8 @@
 
 
 CORBA::Object_ptr
-omniPy::makeLocalObjRef(const char* targetRepoId, CORBA::Object_ptr objref)
+omniPy::makeLocalObjRef(const char* targetRepoId,
+			const CORBA::Object_ptr objref)
 {
   ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 0);
 
@@ -467,7 +477,6 @@
 				    ooref->_iopProfiles(), 0,
 				    key.return_key(), 1);
   }
-  CORBA::release(objref);
   return (CORBA::Object_ptr)newooref->_ptrToObjRef(CORBA::Object::_PD_repoId);
 }
 
@@ -537,10 +546,14 @@
 
   if (targetRepoId[0] == '\0') targetRepoId = CORBA::Object::_PD_repoId;
 
-  omniObjRef* newooref     = omniPy::createObjRef(actualRepoId,
-						  targetRepoId,
-						  ooref->_iopProfiles(), 0,
-						  0, 0);
+  omniObjRef* newooref;
+  {
+    omniPy::InterpreterUnlocker _u;
+    newooref = omniPy::createObjRef(actualRepoId,
+				    targetRepoId,
+				    ooref->_iopProfiles(), 0,
+				    0, 0);
+  }
   return createPyCorbaObjRef(targetRepoId,
 			     (CORBA::Object_ptr)newooref->
 			             _ptrToObjRef(CORBA::Object::_PD_repoId));
@@ -554,14 +567,18 @@
 
   cxxobj = omniURI::stringToObject(uri);
 
-  if (cxxobj->_NP_is_pseudo()) {
+  if (CORBA::is_nil(cxxobj) || cxxobj->_NP_is_pseudo()) {
     return cxxobj;
   }
   omniObjRef* cxxobjref = cxxobj->_PR_getobj();
-  omniObjRef* objref    = omniPy::createObjRef(cxxobjref->_mostDerivedRepoId(),
-					       CORBA::Object::_PD_repoId,
-					       cxxobjref->_iopProfiles(),
-					       0, 0);
+  omniObjRef* objref;
+  {
+    omniPy::InterpreterUnlocker _u;
+    objref = omniPy::createObjRef(cxxobjref->_mostDerivedRepoId(),
+				  CORBA::Object::_PD_repoId,
+				  cxxobjref->_iopProfiles(),
+				  0, 0);
+  }
   CORBA::release(cxxobj);
   return (CORBA::Object_ptr)objref->_ptrToObjRef(CORBA::Object::_PD_repoId);
 }
@@ -570,6 +587,7 @@
 CORBA::Object_ptr
 omniPy::UnMarshalObjRef(const char* repoId, NetBufferedStream& s)
 {
+  omniPy::InterpreterUnlocker _u;
   OMNIORB_ASSERT(repoId);
 
   CORBA::ULong idlen;
@@ -637,7 +655,7 @@
       delete [] id;
       id = 0;
 
-      if (!objref) OMNIORB_THROW(MARSHAL,0, CORBA::COMPLETED_MAYBE);
+      if (!objref) OMNIORB_THROW(INV_OBJREF,0, CORBA::COMPLETED_MAYBE);
       return 
 	(CORBA::Object_ptr)objref->_ptrToObjRef(CORBA::Object::_PD_repoId);
     }
@@ -653,6 +671,7 @@
 CORBA::Object_ptr
 omniPy::UnMarshalObjRef(const char* repoId, MemBufferedStream& s)
 {
+  omniPy::InterpreterUnlocker _u;
   OMNIORB_ASSERT(repoId);
 
   CORBA::ULong idlen;
Index: modules/omni30/pyPOAFunc.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/pyPOAFunc.cc,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.3
diff -u -u -r1.12.2.1 -r1.12.2.3
--- modules/omni30/pyPOAFunc.cc	2000/09/21 11:05:49	1.12.2.1
+++ modules/omni30/pyPOAFunc.cc	2001/02/14 15:22:20	1.12.2.3
@@ -27,8 +27,15 @@
 // Description:
 //    POA functions
 
-// $Id: pyPOAFunc.cc,v 1.12.2.1 2000/09/21 11:05:49 dpg1 Exp $
+// $Id: pyPOAFunc.cc,v 1.12.2.3 2001/02/14 15:22:20 dpg1 Exp $
 // $Log: pyPOAFunc.cc,v $
+// Revision 1.12.2.3  2001/02/14 15:22:20  dpg1
+// Fix bug using repoId strings after deletion.
+//
+// Revision 1.12.2.2  2000/11/29 17:11:18  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
 // Revision 1.12.2.1  2000/09/21 11:05:49  dpg1
 // Fix race condition with Py_omniServant deletion.
 //
@@ -330,7 +337,10 @@
     OMNIORB_ASSERT(poa);
 
     try {
-      return PyString_FromString(poa->the_name());
+      char*     name   = poa->the_name();
+      PyObject* pyname = PyString_FromString(name);
+      CORBA::string_free(name);
+      return pyname;
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
   }
@@ -406,9 +416,14 @@
 	return Py_None;
       }
       else {
-	const char* repoId = act->_PR_getobj()->_mostDerivedRepoId();
-	CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(repoId, act);
-	return omniPy::createPyCorbaObjRef(repoId, lobjref);
+	CORBA::Object_ptr lobjref;
+	const char* repoId;
+	{
+	  omniPy::InterpreterUnlocker _u;
+	  repoId  = act->_PR_getobj()->_mostDerivedRepoId();
+	  lobjref = omniPy::makeLocalObjRef(repoId, act);
+	}
+	return omniPy::createPyCorbaObjRef(0, lobjref);
       }
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
@@ -427,19 +442,20 @@
 								  OBJREF_TWIN);
     RAISE_PY_BAD_PARAM_IF(!actobj);
 
-    PortableServer::AdapterActivator_var act;
-    {
+    try {
       omniPy::InterpreterUnlocker _u;
-      act = PortableServer::AdapterActivator::_narrow(actobj);
-    }
-    RAISE_PY_BAD_PARAM_IF(CORBA::is_nil(act));
+      PortableServer::AdapterActivator_var act =
+	PortableServer::AdapterActivator::_narrow(actobj);
 
-    try {
+      if (CORBA::is_nil(act))
+	OMNIORB_THROW(BAD_PARAM, 0, CORBA::COMPLETED_NO);
+
       poa->the_activator(act);
-      Py_INCREF(Py_None);
-      return Py_None;
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+
+    Py_INCREF(Py_None);
+    return Py_None;
   }
 
   static PyObject* pyPOA_get_servant_manager(PyObject* self, PyObject* args)
@@ -459,9 +475,14 @@
 	return Py_None;
       }
       else {
-	const char* repoId = sm->_PR_getobj()->_mostDerivedRepoId();
-	CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(repoId, sm);
-	return omniPy::createPyCorbaObjRef(repoId, lobjref);
+	CORBA::Object_ptr lobjref;
+	const char*       repoId;
+	{
+	  omniPy::InterpreterUnlocker _u;
+	  repoId  = sm->_PR_getobj()->_mostDerivedRepoId();
+	  lobjref = omniPy::makeLocalObjRef(repoId, sm);
+	}
+	return omniPy::createPyCorbaObjRef(0, lobjref);
       }
     }
     catch (PortableServer::POA::WrongPolicy& ex) {
@@ -483,22 +504,23 @@
 								  OBJREF_TWIN);
     RAISE_PY_BAD_PARAM_IF(!mgrobj);
 
-    PortableServer::ServantManager_var mgr;
-    {
+    try {
       omniPy::InterpreterUnlocker _u;
-      mgr = PortableServer::ServantManager::_narrow(mgrobj);
-    }
-    RAISE_PY_BAD_PARAM_IF(CORBA::is_nil(mgr));
+      PortableServer::ServantManager_var mgr =
+	PortableServer::ServantManager::_narrow(mgrobj);
 
-    try {
+      if (CORBA::is_nil(mgr))
+	OMNIORB_THROW(BAD_PARAM, 0, CORBA::COMPLETED_NO);
+
       poa->set_servant_manager(mgr);
-      Py_INCREF(Py_None);
-      return Py_None;
     }
     catch (PortableServer::POA::WrongPolicy& ex) {
       return raisePOAException(pyPOA, "WrongPolicy");
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+
+    Py_INCREF(Py_None);
+    return Py_None;
   }
 
   static PyObject* pyPOA_get_servant(PyObject* self, PyObject* args)
@@ -528,8 +550,11 @@
       else {
 	// Oh dear -- the servant is C++, not Python. OBJ_ADAPTER
 	// seems the most sensible choice of exception.
-	CORBA::OBJ_ADAPTER ex;
-	return omniPy::handleSystemException(ex);
+	{
+	  omniPy::InterpreterUnlocker _u;
+	  servant->_remove_ref();
+	}
+	OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
       }
     }
     catch (PortableServer::POA::NoServant& ex) {
@@ -539,6 +564,7 @@
       return raisePOAException(pyPOA, "WrongPolicy");
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+    return 0;
   }
 
   static PyObject* pyPOA_set_servant(PyObject* self, PyObject* args)
@@ -688,12 +714,13 @@
     OMNIORB_ASSERT(poa);
 
     try {
-      CORBA::Object_ptr objref;
+      CORBA::Object_var objref;
+      CORBA::Object_ptr lobjref;
       {
 	omniPy::InterpreterUnlocker _u;
-	objref = poa->create_reference(repoId);
+	objref  = poa->create_reference(repoId);
+	lobjref = omniPy::makeLocalObjRef(repoId, objref);
       }
-      CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(repoId, objref);
       return omniPy::createPyCorbaObjRef(repoId, lobjref);
     }
     catch (PortableServer::POA::WrongPolicy& ex) {
@@ -720,12 +747,13 @@
 
     try {
       PortableServer::ObjectId oid(oidlen, oidlen, (CORBA::Octet*)oidstr, 0);
-      CORBA::Object_ptr objref;
+      CORBA::Object_var objref;
+      CORBA::Object_ptr lobjref;
       {
 	omniPy::InterpreterUnlocker _u;
-	objref = poa->create_reference_with_id(oid, repoId);
+	objref  = poa->create_reference_with_id(oid, repoId);
+	lobjref = omniPy::makeLocalObjRef(repoId, objref);
       }
-      CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(repoId, objref);
       return omniPy::createPyCorbaObjRef(repoId, lobjref);
     }
     catch (PortableServer::POA::WrongPolicy& ex) {
@@ -783,14 +811,13 @@
     PYOSReleaseHelper _r(pyos);
 
     try {
-      CORBA::Object_ptr objref;
+      CORBA::Object_var objref;
+      CORBA::Object_ptr lobjref;
       {
 	omniPy::InterpreterUnlocker _u;
-	objref = poa->servant_to_reference(pyos);
+	objref  = poa->servant_to_reference(pyos);
+	lobjref = omniPy::makeLocalObjRef(pyos->_mostDerivedRepoId(), objref);
       }
-      CORBA::Object_ptr lobjref =
-	omniPy::makeLocalObjRef(pyos->_mostDerivedRepoId(), objref);
-
       return omniPy::createPyCorbaObjRef(pyos->_mostDerivedRepoId(), lobjref);
     }
     catch (PortableServer::POA::ServantNotActive& ex) {
@@ -837,8 +864,11 @@
       else {
 	// Oh dear -- the servant is C++, not Python. OBJ_ADAPTER
 	// seems the most sensible choice of exception.
-	CORBA::OBJ_ADAPTER ex;
-	return omniPy::handleSystemException(ex);
+	{
+	  omniPy::InterpreterUnlocker _u;
+	  servant->_remove_ref();
+	}
+	OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
       }
     }
     catch (PortableServer::POA::ObjectNotActive& ex) {
@@ -851,6 +881,7 @@
       return raisePOAException(pyPOA, "WrongPolicy");
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+    return 0;
   }
 
   static PyObject* pyPOA_reference_to_id(PyObject* self, PyObject* args)
@@ -904,8 +935,8 @@
 
     try {
       PortableServer::ObjectId oid(oidlen, oidlen, (CORBA::Octet*)oidstr, 0);
-      PortableServer::Servant servant;
-      omniPy::Py_omniServant* pyos;
+      PortableServer::Servant  servant;
+      omniPy::Py_omniServant*  pyos;
       {
 	omniPy::InterpreterUnlocker _u;
 	servant = poa->id_to_servant(oid);
@@ -920,8 +951,11 @@
       else {
 	// Oh dear -- the servant is C++, not Python. OBJ_ADAPTER
 	// seems the most sensible choice of exception.
-	CORBA::OBJ_ADAPTER ex;
-	return omniPy::handleSystemException(ex);
+	{
+	  omniPy::InterpreterUnlocker _u;
+	  servant->_remove_ref();
+	}
+	OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
       }
     }
     catch (PortableServer::POA::ObjectNotActive& ex) {
@@ -931,6 +965,7 @@
       return raisePOAException(pyPOA, "WrongPolicy");
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+    return 0;
   }
 
   static PyObject* pyPOA_id_to_reference(PyObject* self, PyObject* args)
@@ -948,14 +983,16 @@
 
     try {
       PortableServer::ObjectId oid(oidlen, oidlen, (CORBA::Octet*)oidstr, 0);
-      CORBA::Object_ptr objref;
+      CORBA::Object_var objref;
+      CORBA::Object_ptr lobjref;
+      const char* mdri;
       {
 	omniPy::InterpreterUnlocker _u;
-	objref = poa->id_to_reference(oid);
+	objref  = poa->id_to_reference(oid);
+	mdri    = objref->_PR_getobj()->_mostDerivedRepoId();
+	lobjref = omniPy::makeLocalObjRef(mdri, objref);
       }
-      const char*       mdri    = objref->_PR_getobj()->_mostDerivedRepoId();
-      CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(mdri, objref);
-      return omniPy::createPyCorbaObjRef(mdri, lobjref);
+      return omniPy::createPyCorbaObjRef(0, lobjref);
     }
     catch (PortableServer::POA::ObjectNotActive& ex) {
       return raisePOAException(pyPOA, "ObjectNotActive");
@@ -964,6 +1001,7 @@
       return raisePOAException(pyPOA, "WrongPolicy");
     }
     OMNIPY_CATCH_AND_HANDLE_SYSTEM_EXCEPTIONS
+    return 0;
   }
 
   static PyObject* pyPOA_releaseRef(PyObject* self, PyObject* args)
Index: modules/omni30/pyPOAManagerFunc.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/pyPOAManagerFunc.cc,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -u -r1.3 -r1.3.2.1
--- modules/omni30/pyPOAManagerFunc.cc	2000/03/24 16:48:57	1.3
+++ modules/omni30/pyPOAManagerFunc.cc	2000/11/29 17:11:19	1.3.2.1
@@ -27,9 +27,13 @@
 // Description:
 //    POAManager functions
 
-// $Id: pyPOAManagerFunc.cc,v 1.3 2000/03/24 16:48:57 dpg1 Exp $
+// $Id: pyPOAManagerFunc.cc,v 1.3.2.1 2000/11/29 17:11:19 dpg1 Exp $
 
 // $Log: pyPOAManagerFunc.cc,v $
+// Revision 1.3.2.1  2000/11/29 17:11:19  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
 // Revision 1.3  2000/03/24 16:48:57  dpg1
 // Local calls now have proper pass-by-value semantics.
 // Lots of little stability improvements.
@@ -80,6 +84,7 @@
     OMNIORB_ASSERT(pm);
 
     try {
+      omniPy::InterpreterUnlocker _u;
       pm->activate();
     }
     catch (PortableServer::POAManager::AdapterInactive& ex) {
@@ -104,6 +109,7 @@
     OMNIORB_ASSERT(pm);
 
     try {
+      omniPy::InterpreterUnlocker _u;
       pm->hold_requests(wfc);
     }
     catch (PortableServer::POAManager::AdapterInactive& ex) {
@@ -128,6 +134,7 @@
     OMNIORB_ASSERT(pm);
 
     try {
+      omniPy::InterpreterUnlocker _u;
       pm->discard_requests(wfc);
     }
     catch (PortableServer::POAManager::AdapterInactive& ex) {
@@ -152,6 +159,7 @@
     OMNIORB_ASSERT(pm);
 
     try {
+      omniPy::InterpreterUnlocker _u;
       pm->deactivate(eo, wfc);
     }
     catch (PortableServer::POAManager::AdapterInactive& ex) {
@@ -174,7 +182,11 @@
 
     OMNIORB_ASSERT(pm);
 
-    PortableServer::POAManager::State s = pm->get_state();
+    PortableServer::POAManager::State s;
+    {
+      omniPy::InterpreterUnlocker _u;
+      s = pm->get_state();
+    }
     return PyInt_FromLong((int)s);
   }
 
@@ -188,8 +200,10 @@
       (PortableServer::POAManager_ptr)omniPy::getTwin(pyPM, POAMANAGER_TWIN);
 
     OMNIORB_ASSERT(pm);
-    CORBA::release(pm);
-
+    {
+      omniPy::InterpreterUnlocker _u;
+      CORBA::release(pm);
+    }
     omniPy::remTwin(pyPM, POAMANAGER_TWIN);
     omniPy::remTwin(pyPM, OBJREF_TWIN);
 
Index: modules/omni30/pyServant.cc
===================================================================
RCS file: /cvsroot/omniORBpy/modules/omni30/pyServant.cc,v
retrieving revision 1.24.2.4
retrieving revision 1.24.2.6
diff -u -u -r1.24.2.4 -r1.24.2.6
--- modules/omni30/pyServant.cc	2000/09/21 11:05:49	1.24.2.4
+++ modules/omni30/pyServant.cc	2001/02/14 15:22:20	1.24.2.6
@@ -27,9 +27,16 @@
 // Description:
 //    Implementation of Python servant object
 
-// $Id: pyServant.cc,v 1.24.2.4 2000/09/21 11:05:49 dpg1 Exp $
+// $Id: pyServant.cc,v 1.24.2.6 2001/02/14 15:22:20 dpg1 Exp $
 
 // $Log: pyServant.cc,v $
+// Revision 1.24.2.6  2001/02/14 15:22:20  dpg1
+// Fix bug using repoId strings after deletion.
+//
+// Revision 1.24.2.5  2000/11/29 17:11:19  dpg1
+// Fix deadlock when trying to lock omniORB internal lock while holding
+// the Python interpreter lock.
+//
 // Revision 1.24.2.4  2000/09/21 11:05:49  dpg1
 // Fix race condition with Py_omniServant deletion.
 //
@@ -340,34 +347,37 @@
 omniPy::
 Py_omniServant::_default_POA()
 {
-  omnipyThreadCache::lock _t;
-  PyObject* pyPOA = PyObject_CallMethod(pyservant_, (char*)"_default_POA", 0);
-
-  if (pyPOA) {
-    PortableServer::POA_ptr poa =
-      (PortableServer::POA_ptr)omniPy::getTwin(pyPOA, POA_TWIN);
-
-    Py_DECREF(pyPOA);
-    if (poa) {
-      return PortableServer::POA::_duplicate(poa);
+  {
+    omnipyThreadCache::lock _t;
+    PyObject* pyPOA = PyObject_CallMethod(pyservant_,
+					  (char*)"_default_POA", 0);
+    if (pyPOA) {
+      PortableServer::POA_ptr poa =
+	(PortableServer::POA_ptr)omniPy::getTwin(pyPOA, POA_TWIN);
+
+      Py_DECREF(pyPOA);
+      if (poa) {
+	return PortableServer::POA::_duplicate(poa);
+      }
+      else {
+	if (omniORB::trace(1)) {
+	  omniORB::logger l;
+	  l <<
+	    "Python servant returned an invalid object from `_default_POA'.\n"
+	    "Returning Root POA\n";
+	}
+      }      
     }
     else {
       if (omniORB::trace(1)) {
 	omniORB::logger l;
-	l << "Python servant returned an invalid object from `_default_POA'.\n"
-             "Returning Root POA\n";
+	l << "Exception while trying to call _default_POA(). "
+	  "Returning Root POA\n";
+	PyErr_Print();
       }
-    }      
-  }
-  else {
-    if (omniORB::trace(1)) {
-      omniORB::logger l;
-      l << "Exception while trying to call _default_POA(). "
-	   "Returning Root POA\n";
-      PyErr_Print();
+      else
+	PyErr_Clear();
     }
-    else
-      PyErr_Clear();
   }
   CORBA::Object_var obj = omniPy::orb->resolve_initial_references("RootPOA");
   return PortableServer::POA::_narrow(obj);
@@ -378,12 +388,13 @@
 omniPy::
 Py_omniServant::py_this()
 {
-  CORBA::Object_ptr objref;
+  CORBA::Object_var objref;
+  CORBA::Object_ptr lobjref;
   {
     omniPy::InterpreterUnlocker _u;
-    objref = (CORBA::Object_ptr)_do_this(CORBA::Object::_PD_repoId);
+    objref  = (CORBA::Object_ptr)_do_this(CORBA::Object::_PD_repoId);
+    lobjref = omniPy::makeLocalObjRef(repoId_, objref);
   }
-  CORBA::Object_ptr lobjref = omniPy::makeLocalObjRef(repoId_, objref);
   return omniPy::createPyCorbaObjRef(repoId_, lobjref);
 }
 
@@ -949,14 +960,18 @@
 
   omniPy::Py_omniServant* pyos;
   pyos = (omniPy::Py_omniServant*)serv->_ptrToInterface("Py_omniServant");
-  if (!pyos) OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
-  // *** Good choice of exn?
+  if (!pyos) {
+    omniPy::InterpreterUnlocker _u;
+    serv->_remove_ref();
+    OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
+  }
 
   method = PyObject_GetAttrString(pysa_, (char*)"etherealize");
   if (!method) {
     PyErr_Clear();
+    omniPy::InterpreterUnlocker _u;
+    serv->_remove_ref();
     OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
-    // *** Good choice of exn?
   }
   PortableServer::POA::_duplicate(poa);
   argtuple = Py_BuildValue((char*)"s#NNii",
@@ -1148,14 +1163,18 @@
 
   omniPy::Py_omniServant* pyos;
   pyos = (omniPy::Py_omniServant*)serv->_ptrToInterface("Py_omniServant");
-  if (!pyos) OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
-  // *** Good choice of exn?
+  if (!pyos) {
+    omniPy::InterpreterUnlocker _u;
+    serv->_remove_ref();
+    OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
+  }
 
   method = PyObject_GetAttrString(pysl_, (char*)"postinvoke");
   if (!method) {
     PyErr_Clear();
+    omniPy::InterpreterUnlocker _u;
+    serv->_remove_ref();
     OMNIORB_THROW(OBJ_ADAPTER, 0, CORBA::COMPLETED_NO);
-    // *** Good choice of exn?
   }
   PortableServer::POA::_duplicate(poa);
   argtuple = Py_BuildValue((char*)"s#NsNN",
Index: omniidl_be/python.py
===================================================================
RCS file: /cvsroot/omniORBpy/omniidl_be/python.py,v
retrieving revision 1.27.2.3
retrieving revision 1.27.2.4
diff -u -u -r1.27.2.3 -r1.27.2.4
--- omniidl_be/python.py	2000/08/22 11:52:28	1.27.2.3
+++ omniidl_be/python.py	2000/11/01 11:25:56	1.27.2.4
@@ -26,8 +26,11 @@
 #   
 #   Back-end for Python
 
-# $Id: python.py,v 1.27.2.3 2000/08/22 11:52:28 dpg1 Exp $
+# $Id: python.py,v 1.27.2.4 2000/11/01 11:25:56 dpg1 Exp $
 # $Log: python.py,v $
+# Revision 1.27.2.4  2000/11/01 11:25:56  dpg1
+# Recursive structs inside interfaces were broken
+#
 # Revision 1.27.2.3  2000/08/22 11:52:28  dpg1
 # Generate inherited classes for typedef to struct/union.
 #
@@ -333,10 +336,14 @@
 _tc_@tdname@ = omniORB.tcInternal.createTypeCode(_ad_@tdname@)
 omniORB.registerType(@tdname@._NP_RepositoryId, _ad_@tdname@, _tc_@tdname@)"""
 
-recursive_struct_descr = """
+recursive_struct_descr_at_module_scope = """
 # Recursive struct @sname@
 _0_@modname@._d_@sname@ = (omniORB.tcInternal.tv__indirect, ["@repoId@"])"""
 
+recursive_struct_descr = """
+# Recursive struct @sname@
+_d_@sname@ = (omniORB.tcInternal.tv__indirect, ["@repoId@"])"""
+
 struct_class = """
 # struct @sname@
 class @sname@:
@@ -1012,10 +1019,16 @@
         sname = mangle(node.identifier())
 
         if node.recursive():
-            self.st.out(recursive_struct_descr,
-                        sname   = sname,
-                        repoId  = node.repoId(),
-                        modname = self.modname)
+            if self.at_module_scope:
+                self.st.out(recursive_struct_descr_at_module_scope,
+                            sname   = sname,
+                            repoId  = node.repoId(),
+                            modname = self.modname)
+            else:
+                self.st.out(recursive_struct_descr,
+                            sname   = sname,
+                            repoId  = node.repoId(),
+                            modname = self.modname)
 
         self.st.out(struct_class, sname = sname, repoId = node.repoId())
 
Index: python/omniORB/PortableServer.py
===================================================================
RCS file: /cvsroot/omniORBpy/python/omniORB/PortableServer.py,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -u -r1.7 -r1.7.2.1
--- python/omniORB/PortableServer.py	2000/05/25 16:07:44	1.7
+++ python/omniORB/PortableServer.py	2000/11/28 14:50:26	1.7.2.1
@@ -28,9 +28,12 @@
 #    PortableServer module
 
 
-# $Id: PortableServer.py,v 1.7 2000/05/25 16:07:44 dpg1 Exp $
+# $Id: PortableServer.py,v 1.7.2.1 2000/11/28 14:50:26 dpg1 Exp $
 
 # $Log: PortableServer.py,v $
+# Revision 1.7.2.1  2000/11/28 14:50:26  dpg1
+# Typo in method name.
+#
 # Revision 1.7  2000/05/25 16:07:44  dpg1
 # Servant._default_POA now caches the root POA.
 #
@@ -164,7 +167,7 @@
     def create_id_assignment_policy(self, value):
         return IdAssignmentPolicy(value)
 
-    def create_implict_activation_policy(self, value):
+    def create_implicit_activation_policy(self, value):
         return ImplicitActivationPolicy(value)
 
     def create_servant_retention_policy(self, value):
@@ -247,7 +250,7 @@
                    "create_lifespan_policy",
                    "create_id_uniqueness_policy",
                    "create_id_assignment_policy",
-                   "create_implict_activation_policy",
+                   "create_implicit_activation_policy",
                    "create_servant_retention_policy",
                    "create_request_processing_policy",
                    "_get_the_name",
