Sagepay 2.8 error - "There is already an object named 'SagePayServerTransaction' in the database."

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I have a 2.80 nopcommerce install and have added the Sagepay server plugin. It appears in the plugin list but when I install I get the error in the title. The full error text from the log is

System.Data.SqlClient.SqlException (0x80131904): There is already an object named 'SagePayServerTransaction' in the database. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters) at System.Data.Entity.Internal.InternalContext.ExecuteSqlCommand(String sql, Object[] parameters) at System.Data.Entity.Database.ExecuteSqlCommand(String sql, Object[] parameters) at Nop.Plugin.Payments.SagePayServer.Data.SagePayServerTransactionObjectContext.InstallSchema() at Nop.Plugin.Payments.SagePayServer.SagePayServerPaymentProcessor.Install() at Nop.Admin.Controllers.PluginController.Install(String systemName) ClientConnectionId:7a7108d6-094b-4373-bdfe-42e012a83156

I successfully installed the Sagepay plugin on a different install, which was v2.65. Anyone any ideas?
11 years ago
Ive tried installing a clean 3.0 install and get the same error
11 years ago
If you can open up the database and delete the table SagePayServerTransaction and then try installing again.
10 years ago
I appear to be having the same trouble - and cannot see that Table within the database, could you be more specific?
10 years ago
axdaws wrote:
If you can open up the database and delete the table SagePayServerTransaction and then try installing again.

Thanks. That worked :)
10 years ago
That's great Andy - where did you find the Table to remove? as I cannot seem to locate it?

(just in case i'm being dense) - is it within SQL Server?
10 years ago
axdaws wrote:
If you can open up the database and delete the table SagePayServerTransaction and then try installing again.


Hi, Do you know why this error is appearing in the first place? Is the plugin trying to install the db schema twice and if so, do you know where in the source this is happening. I don't want my client to have to manually edit the db in order in install this plugin!

Thanks

H
10 years ago
I found the potential issue with the source under the InstallSchema method in the object context. I added in the same initialiser nullification as required for the SQL Server compact and it cleared the problem from installation during a full application installation - see bold. Bear in mind I'm using MSSQL Server 2008 not compact so it was interesting to see that this fixed the problem. I'll notify the Microlite guys as well so they can update.

public void InstallSchema() {
            Database.SetInitializer<SagePayServerTransactionObjectContext>(null);
            Database.ExecuteSqlCommand(CreateDatabaseInstallationScript());
            SaveChanges();
        }


H
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.