Message from discussion
daoSession property
Date: Sun, 4 Nov 2012 12:25:27 -0800 (PST)
From: Markus Junginger <mar...@greenrobot.de>
To: greendao@googlegroups.com
Message-Id: <6f1cd72f-a853-457b-b5d0-e1c083a0cd6d@googlegroups.com>
In-Reply-To: <67b86754-26b8-42b9-aa83-57727e2fbe71@googlegroups.com>
References: <67b86754-26b8-42b9-aa83-57727e2fbe71@googlegroups.com>
Subject: Re: daoSession property
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_279_16693464.1352060727321"
------=_Part_279_16693464.1352060727321
Content-Type: multipart/alternative;
boundary="----=_Part_280_18447303.1352060727321"
------=_Part_280_18447303.1352060727321
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
>
> I'm adding some function in the keep section of the entity.
> Can I use safety the daoSession and the myDao property or I need to pass
> the current session and the dao instance?
>
Depends. If the entity is always loaded by greenDAO you should be fine. If
you have to cope with new (unpersisted) entities, you should have your own
references to the session/DAO.
------=_Part_280_18447303.1352060727321
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I'm adding some function in the keep section of the entity.<br><div>Can I use safety the daoSession and the myDao property or I need to pass the current session and the dao instance?<br></div></blockquote><div>Depends. If the entity is always loaded by greenDAO you should be fine. If you have to cope with new (unpersisted) entities, you should have your own references to the session/DAO.</div>
------=_Part_280_18447303.1352060727321--
------=_Part_279_16693464.1352060727321--