I have yet to see a web service where the database interactions do not leak into the business code.
If i understand you basically any time a developer uses an orm he would be mixing the DB interactions with business logic but i want to be sure what you mean.
Thanks!
Here is an example from the Django documentation [0]:
selected_choice.votes += 1
selected_choice.save()
The offender in my eyes is the save() method call. The first line is business logic, but the second line has nothing to do with business logic. It might be slightly better to hide the database interaction in the object itself, create a special method, and change the two lines into: selected_choice.increaseVotes(1)
As a counter argument, I dislike code which hides database accesses, because that easily leads to code which does way to many of them and thus is unnecessarily slow.It seems better to explicitly say when to save things rather than hope that every custom method does that and you have a method for every combination of updates.
The Django ORM also has another case to consider: bulk updates, where separating logic from serialization makes a huge performance win easy and safe.