Home › Forums › kbmMW › ORM with UNIDAC and Firebird CreateOrUpgradeTable doesn’t commit transaction
Tagged: ORM
- This topic has 4 replies, 2 voices, and was last updated 5 years ago by
kimbomadsen.
-
AuthorPosts
-
-
February 6, 2021 at 07:03 #55437
VadimMest
ParticipantHi
ORM with UNIDAC and Firebird
Procedure orm.CreateOrUpgradeTable doesn’t commit transaction.
-
February 6, 2021 at 07:04 #55438
VadimMest
ParticipantI try create new table by object TMRDOC (table MR_DOC)
orm.CreateOrUpgradeTable(TMRDOC);
How can I turn on transaction commit?
This is the SQL log:
05.02.2021 22:24:30 n/a UniDAC monitoring is started Complete
05.02.2021 22:24:36 0.109 Connect: SYSDBA@127.0.0.1 Complete
05.02.2021 22:24:36 0.000 Start: Complete
05.02.2021 22:24:36 0.000 Transaction ID = 78368 Complete
05.02.2021 22:24:36 0.000 SQL Prepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Execute: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Unprepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Prepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Execute: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Unprepare: SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS
WHERE ((RDB$SYSTEM_FLAG = 0) OR (RDB$SYSTEM_FLAG IS NULL)) AND
(RDB$VIEW_SOURCE IS NULL) AND UPPER(RDB$RELATION_NAME)=’MR_DOC’
Complete
05.02.2021 22:24:36 0.000 SQL Execute: CREATE TABLE MR_DOC ( DATEDOC TIMESTAMP,NDOC VARCHAR(20),IDSTATE INTEGER,GUID VARCHAR(36) PRIMARY KEY,ID INTEGER NOT NULL,IDOWNER INTEGER,IDINOWNER INTEGER,RECORDCOLOR VARCHAR(20),RECORDFONT VARCHAR(20),STATUS INTEGER )
Complete -
February 17, 2021 at 23:11 #55472
kimbomadsen
KeymasterReplied previously.
DDL operations are usually not handled under transactional control in SQL. -
February 19, 2021 at 06:29 #55482
VadimMest
ParticipantHello
>DDL operations are usually not handled under transactional control in SQL.
Procedure orm.CreateOrUpgradeTable(TMROWNER) doesn’t finish a creating table in Firebird 2.5 and Firebird 3. The table does not exists in database.
In Firebird Database “CREATE TABLE”, “ALTER TABLE” definitely need a Commit. I can send test project with Firebird based on your demo.I solved this problem with patch (but very many transaction start and commit)
procedure TForm76.Button1Click(Sender: TObject);
procedure CreateTable(const AValue: TClass);
begin
kbmMWInterbaseMetaData.RunMetaUpdatesInTransaction := True;
orm.CreateTable(AValue);
kbmMWInterbaseMetaData.RunMetaUpdatesInTransaction := False;
end;
beginif not orm.ExistsTable(TMRDOC) then
CreateTable(TMRDOC)
else
orm.UpgradeTable(TMRDOC); -
February 19, 2021 at 08:58 #55486
kimbomadsen
KeymasterTry to set RunMetaUpdatesInTransaction to true in the metadata component you are using.
best regards
Kim/c4d
-
-
AuthorPosts
- You must be logged in to reply to this topic.
