You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala...@googlegroups.com
Let's say I want:
Select a row from a database
Do some processing with it
insert/update some rows according to the computation
I want to do this in a single transaction. I can flatmap/map all the actions and apply the .transactionally combinator and then db.run() on the final action and it would work.
However, I want non-database computations to run in another execution context so I do not use the thread pool used for DB operations. Please suggest your solutions.
Christopher Vogt
unread,
Feb 20, 2015, 12:56:51 PM2/20/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala...@googlegroups.com, Stefan Zeiger
Slicks DBIO is tuned for exactly that and does it out of the box. Have
the implicit execution context in scope you want to run computations on.
Slick will use it. For blocking queries Slick uses a separate one Slick
manages.
@szeiger may want to elaborate more on the details.
On 20.02.15 07:25, Laurynas Tretjakovas wrote:
> Let's say I want:
>
> 1. Select a row from a database
> 2. Do some processing with it
> 3. insert/update some rows according to the computation
>
> I want to do this in a single transaction. I can flatmap/map all the
> actions and apply the .transactionally combinator and then db.run() on
> the final action and it would work.
> However, I want non-database computations to run in another execution
> context so I do not use the thread pool used for DB operations. Please
> suggest your solutions.
>