Hello,
This issue has a major impact in our transactions…
A second company has been added to our Production env. And since then, one of our major .net app, which runs ever hour to perform transactions via BO, gives us an error as follows:
TV is one of our current site from original company
MAJZone is our application.
Ice.BLException: Access to site TV denied at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Ice.Proxy.Lib.SessionModImpl.SetPlant(String newSite, String& siteName) at Ice.Core.Session.set_PlantID(String value) at MAJZone.Program.AutomaticMAJ(Session session, String plant) at MAJZone.Program.Main(String[] args)
(I was not the one who designed this, but it is working since 6 years ago)
I have found the code which is used to create the session:
static void Main(params string[] args)
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
var path = @"C:\Prog\Epicor102600\Client\Config\Polymos-Prod.sysconfig";
if (args.Length > 0 && args[0].EndsWith(".sysconfig"))
path = args[0];
var session = new Ice.Core.Session("user", "pw", Ice.Core.Session.LicenseType.Default, path);
AutomaticMAJ(session, "TV");
AutomaticMAJ(session, "VD");
}
private static void AutomaticMAJ(Ice.Core.Session session, string plant)
{
session.PlantID = plant;
using (var db = new EpicorDataContext(session))
{
try
{
var extractor = new Extractor(db);
var processor = new Processor(db);
var todo = extractor.ExtractData();
processor.ProcessData(todo);
}
catch(Exception ex)
{
EmailHandler.HandleException(ex, db, "Erreur lors de la mise à jour de zone automatique", "Usine : " + plant);
}
}
}
The new company was created at 14:45 today, and on the next run of the application (which is run on the server via Task manager) got the error of access denied.
I do not think it is a coincidence. I truly beleive that the new company is causing this. ( we have opened a ticket at Epicor about the issue)
But I was wandering if the call to the session creation can maybe be modified to address for which company we are trying to connect ? At least we could run the program without the error…
Thank you for your input.
Pierre