yonjah / node_acl_sequelize

Node Acl Sequelize Backend
MIT License
44 stars 20 forks source link

Always executes over default transaction #27

Closed igordeoliveirasa closed 5 years ago

igordeoliveirasa commented 5 years ago

I need acl methods run over my began transaction not over default transactions.. how could I do?

yonjah commented 5 years ago

I don't think acl API will support anyway for you to pass the transaction

Your only bet might be to try and use CLS - http://docs.sequelizejs.com/manual/transactions.html

Sequelize has a few issues handling transactions so make sure you use a recent version (and even than your mileage may vary)

igordeoliveirasa commented 5 years ago

@yonjah anyway, node_acl_sequelize is not respecting my began transactions.. I cant use CLS since it works globally.. lets suppose I have 2 users accessing my API at the same time.. It would be a mess..

yonjah commented 5 years ago

@igordeoliveirasa CLS works on the Promise chain that created the transaction It won't collide between two users. Since node_acl API will not allow for extra parameters I don't think there is any other option that will work