You must consider certain requirements and limitations before you use the GemFire XD
import and export procedures.
- Database transactions
- You should issue either a COMMIT or ROLLBACK statement to complete all transactions and release
all table-level locks before you invoke an import or export procedure. GemFire XD issues a
COMMIT or a ROLLBACK statement after each import and export procedure is run.
Note: Imports are
transactional. If an error occurs during bulk import, all changes are rolled back.
- Client connections
- Other user applications that access the table with a separate connection do not need to
disconnect before you initiate an export or import procedure.
- The table must exist
- To import data into a table, the table must already exist in GemFire XD. The table does not have
to be empty. If a partitioned table is empty, use the SYS.CREATE_ALL_BUCKETS procedure to pre-allocate partitioned table buckets
before you import any data into the table. This helps to ensure that partitioned table
data is evenly distributed throughout the distributed system, even if you import table data
using concurrent processes.
- Create indexes, keys, and unique constraints before you import
- To avoid a separate step, create the indexes, keys (primary and foreign),
and unique constraints on tables before you import data. However, if your
memory and disk spaces resources are limited, you can build the indexes and
primary keys after importing data.
- Data types
- GemFire XD implicitly converts the strings to the data type of the receiving column. If any of
the implicit conversions fail, the whole import is aborted. For example, "3+7" cannot be
converted into an integer. An export that encounters a runtime error stops.
Note: You cannot
import or export the XML data type.
- Locking during import
- The standard import procedures use the same isolation level as the connection in which they are
executed to insert data into tables, and the entire table is exclusively locked during the
import. Use the "_EX" versions of the import procedures if you do not want to lock the target
table during the import.
- Locking during export
- Export procedures use the same isolation level as the connection in which
they are executed to fetch data from tables.
- Column constraints
- Import procedures use the configured column constraints unless you include the REPLACE
parameter (which ignores only primary key constraints) or you set the skip-constraint-checks property (which ignores primary key, foreign key, and unique
- AsyncEventListener behavior
- GemFire XD sends import events to configured AsyncEventListener or DBSynchronizer
implementations unless you set the skip-listeners connection property.
- Import behavior on tables with triggers
- The import procedures enables INSERT triggers when data is appended to
the table. The REPLACE parameter is not allowed when triggers are enabled
on the table.
- Restrictions on the REPLACE parameter
- If you import data into a table that already contains data, you can either replace or append to
the existing data. Use the REPLACE parameter on tables that have dependent tables only when the
replaced data maintains referential integrity. You cannot use the REPLACE parameter if the
table has triggers enabled.
- Restrictions on tables
- You cannot use import procedures to import data into a system table or
a declared temporary table.