I'm having a problem when creating a row and later on selecting it while still under the same transaction.
Whenever I execute the following code I usually get an empty array and rarely get an array with the newly created row.
This is a sample of the code I run:
return seq.transaction((tx) => {
const options = {transaction: tx};
return model.create(user, options)
.then(() => {
return model.findAll({
include: {
all: true
}
}, options)
.then((data) => ({
console.log(data);
});
});
Is there something basic I'm missing here? Thanks!