-
Notifications
You must be signed in to change notification settings - Fork 21
Add a new EntityActions that remove all "transactionally" code #78
Comments
You have a good point. Currently all functionally in EntityActions that need .transactionally will be broken if we remove it. Functionally that will be totally broken are:
There is already a fix for slick/slick#1274, PR is here: slick/slick#1461 So I wonder if it makes sense to change Active Slick if it'll be fixed in 3.2.0. |
@rcavalcanti Sorry for leaving for a long time. (for {
rowA <- modelA.save
rowB <- modelB.save
} yield {
true
}).transactionally This code used by active-slick will take 3 transactionally. It will bring different meanings. I can't 100% believe that the code will work as what I expected. So if sometime I have to save some many to many models(about 3 tables), I need to controller the transactionally by myself. This is the main reason that I suggest to add a new EntityActions trait( with another name ) that all without transactionally. |
As far I understand, there is no nested transactions, therefore we will not have 3 transactions, but only one. Indeed, the I personally think that we should adopt the principle of least surprise. In your example, the code runs in a single transaction and that's not a surprise because you explicitly added a call to The same for the current
That said, the only reason for an |
Oh, I see. Thanks a lot! |
as the issue here slick/slick#1274
use transactionally can bring deadlocks, any way, transactionally code is slowly than no transactionally code.
So I suggest that can active-slick provide a new EntityActions trait that remove all the transactionally code to give us more chice.
The text was updated successfully, but these errors were encountered: