如何在Slick中设置ThreadPool大小?

时间:2018-09-18 15:54:35

标签: scala slick slick-3.0

如何设置光滑的threadPool大小?

这是我的配置:

pp {
  profile = "slick.jdbc.OracleProfile$"
  db {
    url                 = "jdbc:oracle:thin:@52.4.90.244:1521:pp"
    driver              = oracle.jdbc.OracleDriver
    keepAliveConnection = true
    connectionPool      = disabled
    user                = "xxx"
    password            = "xxx"
  }
}

实际上我只在流中执行一个查询,我真的需要一个threadPool吗?我的目标只是从表中检索所有行。

到目前为止,我遇到以下错误:

*** (s.basic.BasicBackend.stream) Signaling onSubscribe(slick.jdbc.JdbcBackend$JdbcStreamingActionContext@76f2bbc1)
*** (s.basic.BasicBackend.action) #1: [fused] cleanUp
      try: andThen
        1: PushStatementParameters StatementParameters(ForwardOnly,ReadOnly,null,null,100)
        2: StreamingResultAction [select * FROM DRUG]
*** (s.basic.BasicBackend.action) #2: SynchronousDatabaseAction.Pin
*** (s.basic.BasicBackend.action) #3: [fused] andThen
      1: PushStatementParameters StatementParameters(ForwardOnly,ReadOnly,null,null,100)
      2: StreamingResultAction [select * FROM DRUG]
*** (s.basic.BasicBackend.action) #4: SynchronousDatabaseAction.Pin
*** (s.basic.BasicBackend.action) #5: SynchronousDatabaseAction.Unpin
*** (s.basic.BasicBackend.stream) Signaling onError(java.util.concurrent.RejectedExecutionException: Task slick.basic.BasicBackend$DatabaseDef$$anon$2@3061964c rejected from slick.util.AsyncExecutor$$anon$2$$anon$1@55d260cc[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0])

0 个答案:

没有答案