Anyone using ArcSDE application server connections (also known as three-tier connections) in ArcGIS 10.1 should be aware of a problem that can result in connections being inadvertently made to the wrong database, if more than one connection is being used.
The issue manifests itself if you are already connected to an ArcSDE database using an application server connection, and then create a new connection (i.e, by using the ‘Create ArcSDE Connection File’ tool). When this is created, ArcCatalog incorrectly popluates the connection properites with the values from the existing ArcSDE connection. This results in a connection being made to the original database/schema, rather than the one you specified in the Geoprocessing tool.
This has been identifed as a bug (NIM082942), and has been fixed in the forthcoming release of ArcGIS 10.2.
Please note that v10.2 will be the last release to include ArcSDE application server, and Esri encourages uses to use Database Connections that were introduced in v10.1 (i.e. using the 'Add Database Connection' dialog in ArcGIS Desktop).