In version 5.0.0.22, still urgent bug:
We have two tables parent and child with relation ship. All parent and child auto generated ID from trigger. Script below:
Code: Select all
CREATE TABLE v2_data_File(
File_Id NUMBER(10, 0) NOT NULL,
Message_Id NUMBER(10, 0) NOT NULL,
File_Name NVARCHAR2(128) NOT NULL,
Body LONG RAW NOT NULL,
CONSTRAINT v2_PK28 PRIMARY KEY (File_Id)
)
;
CREATE TABLE v2_data_Message(
Message_Id NUMBER(10, 0) NOT NULL,
Parent_Id NUMBER(10, 0),
Body NVARCHAR2(512) NOT NULL,
Created_Date TIMESTAMP(6) NOT NULL,
Created_By NVARCHAR2(256) NOT NULL,
Flag CHAR(1) NOT NULL,
CONSTRAINT v2_PK01 PRIMARY KEY (Message_Id)
)
;
Code: Select all
BasicDataContext db = new BasicDataContext();
Message msg1 = new Message() { Body = DateTime.Now.ToLongDateString(), CreatedBy = "admin1", CreatedDate = DateTime.Now, Flag = "S" };
Message msg2 = new Message() { Body = DateTime.Now.ToLongDateString(), CreatedBy = "admin2", CreatedDate = DateTime.Now, Flag = "S" };
//db.Messages.InsertAllOnSubmit(new Message[] { msg1, msg2 });
db.Messages.InsertOnSubmit(msg2);
db.SubmitChanges();
File file = new File { Body = new byte[] { 0, 1, 2 }, FileName = "abc", Message = msg2 };
db.Files.InsertOnSubmit(file);
db.SubmitChanges(); // Value of member 'FileId' of an object of type 'File' changed.A member that is computed or generated by the database cannot be changed.