Search

optimistic concurrency error with datetimeoffset fields upon update by d4e666

Closed

1
0
Sign in
to vote
Type: Bug
ID: 766419
Opened: 10/6/2012 6:23:28 AM
Access Restriction: Public
1
Workaround(s)
0
User(s) can reproduce this bug
in my database I have added 3 datetimeoffset(7) fields to record when a record is inserted, updated or deleted. All fields are nullable but date inserted and date updated are set to thefaultvalue getutcdate(). Every time I want to save a record in SSMS I get the notification that data has changed. This seems unlikly since

1. I am the only user on the database
2. The database is local to my system
3. I get this on overy record which seems rather unlikly that someone else is changing my data
Details (expand)

Product Language

English

Version

SQL Server 2008 R2 SP1

Category

Tools (SSMS, Agent, Profiler, Migration, etc.)

Operating System

Windows 7 Ultimate (SP1)

Operating System Language

Dutch

Steps to Reproduce

create the table using the following script

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ApplicationInvariant]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ApplicationInvariant](
    [ApplicationID] [uniqueidentifier] ROWGUIDCOL NOT NULL,
    [Code] [varchar](255) NOT NULL,
    [Tag] [varchar](255) NOT NULL,
    [SortOrder] [int] NULL,
    [DateCreated] [datetimeoffset](0) NULL,
    [CreatedBy] [uniqueidentifier] NULL,
    [DateLastModified] [datetime2](7) NULL,
    [LastModifiedBy] [uniqueidentifier] NULL,
    [DateDeleted] [datetime2](7) NULL,
    [DeletedBy] [uniqueidentifier] NULL,
    [IsVisible] [bit] NOT NULL,
    [ParentApplicationID] [uniqueidentifier] NULL,
CONSTRAINT [PK_ApplicationInvariant] PRIMARY KEY CLUSTERED
(
    [ApplicationID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO

SET ANSI_PADDING OFF
GO

IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_ApplicationInvariant_ApplicationID]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[ApplicationInvariant] ADD CONSTRAINT [DF_ApplicationInvariant_ApplicationID] DEFAULT (newid()) FOR [ApplicationID]
END

GO

IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_ApplicationInvariant_IsVisible]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[ApplicationInvariant] ADD CONSTRAINT [DF_ApplicationInvariant_IsVisible] DEFAULT ((1)) FOR [IsVisible]
END

Actual Results

everytime a record is edited the message telling that the data has changed appears.

Expected Results

that this messageonly shows when the data has acutally been changed by another user

Platform

X64

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/6/2013 at 11:51 AM
Hi!, thanks for writing in to Microsoft and reporting this bug.

We took a look at this bug and triaged it against several others and unfortunately, it did not meet the bar to be fixed. While we are closing this bug as 'won't fix', we have taken note of this internally and we will try & incorporate this request when we revisit this functionality in a future release of SSMS.

Regards,
Sanjay Nagamangalam, SQL Server Manageability
Sign in to post a workaround.
Posted by d4e666 on 10/6/2012 at 6:24 AM
convert all datetimeoffset fields to datetime2 fields for the moment. This only matters when I start deploying my application worldwide