Developer forum

Forum » Development » The table is locked. Please try again later.

The table is locked. Please try again later.

Dmitrij Jazel
Reply

Hi guys,

Attempted to add a custom product field.

But got an error in the /Admin backend.

"The table is locked. Please try again later."

http://screencast.com/t/qZDeJxqjWNww

Waited for a while, but still can't add the field, and still getting the same error?

Tryed searching forum for this error, or manuals, but no luck. Any particular reason why this table should be locked in some way?

 

/Dmitrij


Replies

 
Nicolai Høeg Pedersen
Reply

Are you in design mode in SQL-Server?

And how many fields do you have? We have a limit, meaning SQL have a limit.

 
Martin Grønbekk Moen
Reply

This is what happened.

First I deleted two fields that was there by "default" (ItemCode and TaxCode), dont know why they are there, but I dont need them.
Then I tried to create a new Product Field, and I was given this error message.

So we are only trying to add one field, not thousands :P

 
Martin Grønbekk Moen
Reply

I found an solution for this, but it kinf of looks like an bug on your side.
Anyway, if anyone else is struggling with the same issue, looks like you have to insert the "ItemCode" again, looks like it has to be at least one ProductField in the table at all times.

Here is the query to add the field manually:

INSERT INTO EcomProductField (ProductFieldID, ProductFieldName, ProductFieldSystemName, ProductFieldTemplateName, ProductFieldTypeID, ProductFieldTypeName, ProductFieldLocked, ProductFieldSort, ProductFieldListPresentationType)
VALUES ('FIELD1', 'ItemCode', 'ItemCode', 'ItemCode', 1, 'Tekst (255)', 0, 0, 1)

After doing this I was able to add my new ProductField.

 
Martin Grønbekk Moen
Reply

Well I guess this was not the best approach... Now I get an exception while trying to rebuild my index.

[501] An error occured while updating an index.

Index: Products
Date: 8/17/2015 2:46:07 PM
Solution:
Error message: Column 'ItemCode' does not belong to table Table.
Call stack: at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.get_Item(String columnName)
at System.Data.DataTableReader.get_Item(String name)
at Dynamicweb.eCommerce.Products.ProductFieldValueCollection..ctor(String languageID, IDataReader DataReader)
at Dynamicweb.eCommerce.Products.Product.Fill(IDataReader dataReader)
at Dynamicweb.eCommerce.Products.Product..ctor(IDataReader dataReader)
at Dynamicweb.eCommerce.Searching.Index.ProductIndexEntry.Create(IDataReader reader)
at Dynamicweb.eCommerce.Searching.Index.ProductIndexer.Index(IndexerDataRequest request)
at Dynamicweb.Searching.Indexer.PerformIndexModifications(IEnumerable`1 fromEntries, IndexUpdateParameters parameters)
at Dynamicweb.Searching.Indexer.PerformUpdate(IEnumerable`1 data, IndexerQueueContentType expectedContentType, IndexUpdateParameters parameters)
at Dynamicweb.Searching.IndexManager.UpdateIndexInternal(Indexer i, Boolean isFullUpdate, Boolean updateSpell, IDictionary`2 flags)
 
Martin Grønbekk Moen
Reply

The saga continues...

I tried to delete the 'ItemCode' manually from SQL, but it did not help.
Then I tried to create another new ProductField, and then I was able to rebuild my index, and everything looks okay!

But I think you need to look into this mess, if there always has to be atleast one ProductField, then you need to add some kind of validation.
 

 
Vladimir
Reply

Hi Martin and Dmitrij,
no, there is no such limitation. But something went wrong at some point..
I will add a clear error description to help to identifying what happened 

Best regards,

Vladimir

 

 
Mikkel Høst
Reply

Hi.

I found the solution. The problems is the EcomNumbers table. If the "NumberType" Field is behind it will say it's locked. Just alter the number to a the value where the ProductFieldIdX is

 

You must be logged in to post in the forum