Inserting into primary and foreign key columns
196
•
The second user's transaction begins before the first user's transaction
commits.
•
The second user tries to update after the first user's transaction commits,
but before the join index is synchronized.
This problem occurs because Adaptive Server IQ makes a new version of the
join index when any of its underlying tables is updated. The new version is not
visible to other transactions that have already begun. The problem does not
occur when one user makes all of the changes, because the newer table version
is visible to the user who made the original changes.
For example, assume that tables A, B, and C are all members of the same join
index. User 2 begins a transaction, and writes to another table not involved in
the join. Now, User 1 inserts into table B. This action creates a new version of
table B, and a new version of the join index. User 2 then tries to write to table
C. Even though no other user has changed table C, because C is a member of
the join index it can't be updated until the join index is synchronized.
For more information on join indexes, see Chapter 4, “Adaptive Server IQ
Indexes” For more information on transaction processing, see Chapter 8,
“Transactions and Versioning”
Inserting into primary and foreign key columns
You load or insert data into primary key and foreign key columns just as you
would into any other column.
When you insert into a single-column primary key, Adaptive Server IQ checks
that each value is unique. If it is not, an error occurs.
When you insert into multi-column primary keys, you are responsible for
making sure that the values in the primary key columns uniquely identify each
row. Adaptive Server IQ does not enforce multi-column primary key
uniqueness.
When you insert into foreign key columns, you are responsible for making sure
that the values match those in the column they reference. Adaptive Server IQ
does not enforce foreign keys. For example, in the sample database, the
cust_id
column in the
sales_order
table is a foreign key that references the
id
column
in the
customer
table. You must insert values directly into both of these
columns, and ensure that they match.
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...