Publisher service is getting crash while publishing certain type of components. This type of components fetch data from external oracle database .This is happening while we try to publish multiple component if we publish single component then publishing works well.below is error in event viewer of CMS server
Application: TcmPublisher.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean, Boolean, System.Data.CommandBehavior)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
at Tridion.Extensions.ContentManager.Templating.OracleBI.GetData(System.String)
Here is templete code
public override void Transform(Engine engine, Package package)
{
OracleConnection connection = new OracleConnection();
try
{
Initialize(engine, package); // Intializing Tridion Engine
string connectionString = getSystemConfiguration(engine.PublishingContext.PublicationTarget.Title + ".OracleConnectionString", pub);
//Oracle Command
OracleCommand command = new OracleCommand("", connection);
connection.ConnectionString = connectionString;
try
{
connection.Open(); //Opening the oracle database connection
}
catch
{
throw new Exception("Could not connect to database for reading oracle Data.");
}
//Here is long code for reading data and processing data
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
if (connection.State == ConnectionState.Open)
connection.Close();//closing the database connection
}
}