<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tototoshi</author_name>
  <author_url>https://blog.hatena.ne.jp/tototoshi/</author_url>
  <blog_title>tototoshi の日記</blog_title>
  <blog_url>https://tototoshi.hatenablog.com/</blog_url>
  <categories>
    <anon>Scala</anon>
  </categories>
  <description>遅延評価と副作用は相性悪いよねって話です。 Scalaでforeachではなくmapの中で副作用を起こすとたまに評価タイミングによるわかりづらいバグに遭遇することがあります。 次のコードはMap#mapValuesの中でscalikejdbcで書き込みを行おうとするコードです。 一見うまくいくようで、エラーになります。手元では java.sql.SQLException: Connection is null. というエラーが発生しています。 import scalikejdbc._ val contents = DB.localTx { implicit session =&gt; data.ma…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftototoshi.hatenablog.com%2Fentry%2F2017%2F03%2F02%2F205313&quot; title=&quot;Scalaで#map系メソッドで副作用を起こすとバグるやつ - tototoshi の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-03-02 20:53:13</published>
  <title>Scalaで#map系メソッドで副作用を起こすとバグるやつ</title>
  <type>rich</type>
  <url>https://tototoshi.hatenablog.com/entry/2017/03/02/205313</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
