When a table has gigabytes of data, the migration crashes with out of memory error. Even though records are expected to be committed in the target database in batches of 5000, the target table remains empty.
Cause: by default the MySQL JDBC driver fetches all records before streaming them to ResultSet.next calls. See more details in this thread.
Solution: set fetch size to Integer.MIN_VALUE on the Statement that selects the rows to copy.
When a table has gigabytes of data, the migration crashes with out of memory error. Even though records are expected to be committed in the target database in batches of 5000, the target table remains empty.
Cause: by default the MySQL JDBC driver fetches all records before streaming them to
ResultSet.next
calls. See more details in this thread.Solution: set fetch size to
Integer.MIN_VALUE
on theStatement
that selects the rows to copy.