Deploying a data package for a table with a timestamp column fails.
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Deploying a data package for a table with a...Expand / Collapse
Author
Message
Posted 01/15/2008 5:31:58 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
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.

Post #13440
Posted 01/15/2008 8:44:49 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
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)

Post #13445
Posted 01/15/2008 8:49:58 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
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...

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

Post #13446
Posted 01/15/2008 8:57:36 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 06/17/2008 9:28:35 AM
Posts: 2,649, Visits: 1,863
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?


www.bungie.net
Post #13450
Posted 01/15/2008 11:10:58 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
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...

Post #13456
Posted 01/15/2008 1:00:21 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 06/17/2008 9:28:35 AM
Posts: 2,649, Visits: 1,863
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.


www.bungie.net
Post #13467
Posted 01/18/2008 4:51:55 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
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

  Post Attachments 
DDTError.jpg (2 views, 43.75 KB)

Post #13557
Posted 01/18/2008 5:09:09 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
Here's an backup of my StrataFrame DB in case you need to reproduce this.

  Post Attachments 
StrataFrame.rar (