Scalaquery problem not implied session

this is a scalaquery query that I want to execute,

... def generateFares(scheduleId:NamedColumn[Int], toCityId:NamedColumn[Int], fromCityId:NamedColumn[Int]):List[(String,Int,String)] = { var list:List[(String,Int,String)] = Nil; val q = for { tf <- ticketingDB.ticketFares if (( tf.scheduleId is scheduleId ) && ( tf.fromCityId is fromCityId ) && ( tf.toCityId is toCityId )) tft <- ticketingDB.ticketFareType if tft.id is tf._7 }{ list = (tft._2, tf._5, tf._6)::list } list } ... 

In this connection, I get a compilation error:

  could not find implicit value for parameter session: org.scalaquery.session.Session 

in the second call. (tft <- ticketingDB)

I cannot understand this scalaquery behavior.

ps: I can guarantee that the method is called inside the withSession block.

please help me debug and create a free connection without errors.

+7
source share
1 answer

Sorry, I post the solution as a comment,

I myself understood the answer. you need to import threadLocalSession to get the session object.

 import org.scalaquery.session.Database.threadLocalSession 
+14
source

All Articles