Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion [no subject]

Received: by 10.42.61.75 with SMTP id t11mr3545471ich.32.1343572478868;
        Sun, 29 Jul 2012 07:34:38 -0700 (PDT)
X-BeenThere: mybatis-user@googlegroups.com
Received: by 10.231.74.223 with SMTP id v31ls3409300ibj.0.gmail; Sun, 29 Jul
 2012 07:34:36 -0700 (PDT)
Received: by 10.42.100.142 with SMTP id a14mr3353991ico.31.1343572475988;
        Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
Received: by 10.42.100.142 with SMTP id a14mr3353990ico.31.1343572475976;
        Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
Return-Path: <jeffgbut...@gmail.com>
Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182])
        by gmr-mx.google.com with ESMTPS id bg4si1466183igb.3.2012.07.29.07.34.35
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
Received-SPF: pass (google.com: domain of jeffgbut...@gmail.com designates 209.85.214.182 as permitted sender) client-ip=209.85.214.182;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jeffgbut...@gmail.com designates 209.85.214.182 as permitted sender) smtp.mail=jeffgbut...@gmail.com; dkim=pass header...@gmail.com
Received: by obbun3 with SMTP id un3so9635270obb.13
        for <mybatis-user@googlegroups.com>; Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=6xEfmZYJFDy8pcM9l+dhl/nCB2aNXf0LB3FPyKcL/HI=;
        b=TQsBHf8Wo4jYw4cIbKwpTUq+pzA0zw1pQF42MoGE18pM24OoKSiYH13km6gydfvYMe
         XKJp3etYuF6A2ogndWCWESRz3kfsP3wE6GepTVX9XXONAzlrmjBbInj34jad0eYeVGd0
         v0YnNSUMkttgLIp7zTjE8tc48tIhTmSKlDetr/SEbbDqVZJ62RRtq2Y9MzVdUd41Hzxy
         xFucxIWvceWrRmXzwXtxb0K1RspGtqVE9a5rFc9uXcbZfRm9glPq7FjwBpUX3YKraTBK
         SafPj9+wsTQSc2+Ym582Bz0fvu2DVRwSJ0liuMSs+es/HrF67gk9m6co1g0sNbL1hKQD
         2rqg==
MIME-Version: 1.0
Received: by 10.182.144.104 with SMTP id sl8mr12905904obb.74.1343572475706;
 Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
Received: by 10.76.24.65 with HTTP; Sun, 29 Jul 2012 07:34:35 -0700 (PDT)
In-Reply-To: <CAJWN2rOcWkDO6ASKYPHa0DtdPFHaJ2qPp3Xc8F2P_TQEgBX...@mail.gmail.com>
References: <CAJWN2rOcWkDO6ASKYPHa0DtdPFHaJ2qPp3Xc8F2P_TQEgBX...@mail.gmail.com>
Date: Sun, 29 Jul 2012 10:34:35 -0400
Message-ID: <CAKpaNj4onabeL9QFp6dDJZp4X=tVNku9eifSyxtd4Jp=jUt...@mail.gmail.com>
Subject: Re:
From: Jeff Butler <jeffgbut...@gmail.com>
To: "mybatis-user@googlegroups.com" <mybatis-user@googlegroups.com>
Content-Type: multipart/alternative; boundary=14dae93998dd24fe7504c5f8d8c1

--14dae93998dd24fe7504c5f8d8c1
Content-Type: text/plain; charset=ISO-8859-1

If you use the raw MyBatis API like this then you must close the session.
MyBatis will not close it for you. The consequences can be uncommitted
transactions and connection leaks.

I think a better pattern is to use the Spring or Guice support.  In that
case the framework will handle everything for you.

Jeff Butler

On Sunday, July 29, 2012, Ravi Thapa wrote:

>
> If i open the session
>
> *SqlMapSession session = sqlMap.openSession()*
>
> and if does not close the session explicitly, what are the consequences,
> does ibatis or Mybatis framework takes care of closing the session.
>
>
>

--14dae93998dd24fe7504c5f8d8c1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

If you use the raw MyBatis API like this then you must close the session. M=
yBatis will not close it for you. The consequences can be uncommitted trans=
actions and connection leaks.=A0<span></span><div><br></div>I think a bette=
r pattern is to use the Spring or Guice support. =A0In that case the framew=
ork will handle everything for you.=A0<div>
<br><div>Jeff Butler<br><br>On Sunday, July 29, 2012, Ravi Thapa  wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><br clear=3D"all"><div>If i open the sessio=
n</div>
<div><br></div><div><pre><b>SqlMapSession session =3D sqlMap.openSession()<=
/b></pre></div>and if does not close the session explicitly, what are the c=
onsequences, does ibatis or Mybatis framework takes care of closing the ses=
sion.=A0=A0<div>

<div><div><br><br>
</div></div></div>
</blockquote></div></div>

--14dae93998dd24fe7504c5f8d8c1--