public void OpenConnection() { Log.Info("DatabaseProxy.OpenConnection"); // connecting to the remote database TcpChannel tcpChannel = new TcpChannel(); ChannelServices.RegisterChannel(tcpChannel); this.db = (PSPEServer.PSPEDatabaseServer)Activator.GetObject( typeof(PSPEServer.PSPEDatabaseServer), "tcp://localhost:8085/MyDatabase"); if (null == db) { Log.Info("Cannot connect to the server"); } else { Log.Info("Internal tx id:" + db.Connect()); } // enlisting in the transaction if (null != this.internalRM) { throw new Exception("we don't support multiple connections, this is just a sample"); } internalRM = new InternalRM(db); internalRM.Enlist(); }
public InternalRM(PSPEServer.PSPEDatabaseServer db) { this.db = db; }