Deploying a data package for a table with a timestamp column fails.


Author
Message
George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Hi there,

I have seen this problem in another topic, but there was no answer mentioned there.

When trying to deploy a data package for a table with a timestamp column, I get the exception:

SqlException: Cannot insert an explicit value into a timestamp column. User INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.

It seems like the DDT is trying to copy the timestamp values taken from the original table, while it shouldn't, since timestamps are updated by SQL server.

Did you come up with a solution for that?

Thank you.

George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Also when trying to modify my tables from the DDT and try to save the changes, I get the error :

DataLayerSavingException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.
SqlException
  The INSERT statement conflicted with the FOREIGN KEY constraint "fk_indexes_indexfields". The conflict occurred in database "StrataFrame", table "dbo.DBEIndexes", column 'idx_pk'.
The statement has been terminated.

Source     : MicroFour StrataFrame Business

Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteReader(DbCommand Command, Boolean IsTransactional, String TransactionKey)
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)
   at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)
   at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)
   at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.Business.BusinessLayer.Save()
   at MicroFour.StrataFrame.Data.TableStructure.CreatePrimaryKeyIndex()
   at MicroFour.StrataFrame.Data.TableStructure.TableStructure_AfterSave(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InvokeAfterSave(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.RaiseAfterSaveEvent(AfterSaveUndoByFormEventArgs e)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnFormClosing(FormClosingEventArgs e)
   at System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)

George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Also sometimes when trying to deploy the package, either from my setup application or the DDT, I get a FileNotFound exception for the file c:\Users\geo.Protogramma\AppData\local\temp\microfour\metadata\DD_8_CustomerTypes.bin. The CustomerTypes is a data package. The name might change from time to time to different data packages.

I am a bug magnet... Doze

I don't know if you can do anything about it but I thought you should know.

StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
1) Sorry, I wasn't aware of that bug... I will add it to the list of fixes for the next release... you are correct, you have to allow SQL Server to assign timestamp values.

2) When you receive that error, does it happen in a predictable manner, like "I always get the error when saving a table that has a UniqueIdentifier PK," or something like that?

3) Haven't seen that one before... does it happen consistently?  Or does it work fine one time and then fail the next?

George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
2. I think I can help you more with this: The DB was imported from SQL Sever 2005. The tables that have this problem have the following behavior: They have a primary key declared, but also in the indexes list, they have a unique index with the same name as the primary key index.

For instance when I create the table completely from within DDT the indexes list is:

which is correct. But when I import from the DB the indexes is like this:

Saving this table's structure will give me the exception. There are some tables that were imported and don't have that problem, and the indexes list is like this:

I could sent you a backup of my DB and also my SF DB if you like.

3. This exception comes from time to time, when I see it again, I will send you screen-shot.

Thanks Ben...

StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I could sent you a backup of my DB and also my SF DB if you like.

I think the info you gave me is enough information; I should be able to reproduce it from this... it certainly points me in the right direction.  Thanks.

George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Hi again

After doing a lot of work to half-import, half-update-manually the DB in the DDT, when finished, I get an exception when trying to create the package.

Here's the whole story:

1. The first problem with uniqueidentifier key not imported correctly was about user-defined data types. I have removed all user-defined data types, from all tables and stored procedures, and it worked.

2. The second issue was about not imported the indexes correctly. So I have imported the database without the indexes and foreign keys, and manually added all indexes and foreign keys.

Now after all this, I get an exception when trying to create the deployment package. I tryied to modify different values on the foreign keys (which was the only modifications made lately), but still nothing. For this I really need your help.

You can find the error in the attached screenshot.

Thank you

Attachments
DDTError.jpg (230 views, 43.00 KB)
George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Here's an backup of my StrataFrame DB in case you need to reproduce this.
Attachments
StrataFrame.rar (196 views, 458.00 KB)
George Nentidis
George Nentidis
StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)StrataFrame Novice (118 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Ok, I think I can help you with that too.

Since the error says "PackageDeploymentDataFromSQL" I have removed and created again all data deployment packages, and it works.

It seems that it needs to add the data packages, after creating the foreign key constraints. Data packages first, foreign keys after, and it crushes.

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It seems that it needs to add the data packages, after creating the foreign key constraints.

OK...I see what happened I think.  This actually depends on how the data deployment package will package up the data.  If you rely on the data package to detect and include all children relationships as well, then yes, I could see how this could happen.  If you do not allow the data package to include the children within that deployment data item and you create an individual deployment data item for each of the children, then this may not have happened.  I will load you package and look at it to see if there is anything that could have prevented this, but that is probably what happened.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search