There are some details within some of the globals to show us what is causing them to be created, but in my BP I don't get why they are being created.

Those that start with $lb(" actually point to the PID within the Application that is being used.

The one BPL in question takes the HL7 ADT message and parses it out into separate Insert/Update etc... stored procedures classes to be called against the BO.

Yes, the "xxxxxx" represent the SQL Connections, however we must maintain 3 different connections as there are 3 different environments we send data to in MS SQL.

Yes, the code should be the same, but there are times where we are testing things in DEV before they go to the TEST MS SQL environment.

Modifying the SQL Connection String at the System level isn't as logical.

I thought it would be easiest to define the Linked Stored Procedure once and just update the Connection String within the Object Script when I was ready to move it to a different MS SQL Environment.

Does your Java Gateway stop or your BO? Is something scanning the ports and causing a blockage, or failure perhaps? Try enabling the Java Gateway log file, I know it's hard to read, but it may give you a clue to what is going on.

Also make sure that the External Language %JDBC Server isn't crashing for some unknown reason. I found that if the %JDBC Server starts having issues that the Java Gateways within your Namespaces start having issues as well.

I had a context variable set to Ens.Response, then when I would make my calls to the BO to execute the Stored Procedure on MS SQL, I would set the Response even though I did not expect thing to Ens.Response and my context variable to callresponse.

Then return Ens.Response at the end of the BP. I figured since it was blank it was not needed and would be creating additional Ens.Response objects.

So I removed the callresponse from those calls that I did not expect anything back from like inserts, etc... because if there was a SQL error the status and error would of be sent back to the BO anyway.

In my adventures, I broke down our BPL's to see where the Custom Message Classes were leaving the Orphaned messages.

Within BPL's make sure if you use Context Variables none of them are sent to "Instantiate", if you end up not using that context variable it will leave a blank (orphaned) message.

Also pointed out by others was not to have the Response object be anything other than Ens.Response. Any other type would cause an Orphaned message created even if you don't use it.

I also took it upon myself to make sure any context variable (message class) that I defined, I set to "" after using it.

Have you checked to see if there is another app using the Port? I know that sometimes the Shutdown doesn't always shutdown the Java Gateways properly, especially if you failover, and fail back to the primary. We have it scripted to make sure that if a Shutdown occurs or if the mirror fails over that the Java Gateways are properly shutdown.