Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL in type column after import #145

Open
betterapp opened this issue Mar 8, 2024 · 2 comments
Open

NULL in type column after import #145

betterapp opened this issue Mar 8, 2024 · 2 comments

Comments

@betterapp
Copy link

Hi

Sometimes during import data DD create records in Objects table with empty type column.
Why ?

image

@betterapp
Copy link
Author

@BlackbitDevs

we use DD: 3.5.43
with Pimcore: 11.1.5

@BlackbitDevs
Copy link
Collaborator

This is caused by optimized bulk saving in DD.
Pimcore's default saving mechanism only saves one object at a time and if anything goes wrong, the transaction gets rolled back. However, when not using compatibility mode in DD, an optimized saving approach gets used. This executes only one INSERT ... ON DUPLICATE KEY UPDATE statement per table for a batch of 100 items. This is much faster. The disadvantage of this approach is that for new objects we first have to execute the INSERT statement to objects table because all the other tables need the object id. So while the INSERT INTO objects may have succeeded there may be a unique key violation in the object_store_Product or any other error. But this is not wrapped in a transaction because then we had deadlocks with this in the past. For this reason we have introduced some cleanup at the end of the import which deletes all orphaned entried from objects table at the end. But somehow this contained a condition for o_parentId IS NULL - but this is not true in your case, so I removed this condition in 3.5.50 so that the cleanup should now work in your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants