Re: Record caching
Franck Routier <[email protected]> Mon, 08 Jun 2009 12:56:49 +0200
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <1244458609.8010.8.camel@franck-laptop> |
Hi,
just to add my two (euro) cents, I think you could use a different
dataSet to handle your configuration information.
SDataSet configDs = new SDataSet();
[...]
ses.begin(configDs);
ses.query(qry); // retrieve you config information
ses.session.commitAndDetachDataSet();
you can cache this configDs somewhere if you want (servlet session or
whatever).
When you work with "real" data, use another dataSet.
SDataSet workDs = new SDataSet();
ses.begin(workDs);
ses.flush()
[... do what you need here, eventually using the detached configDs to
access you config information ...]
ses.session.commitAndDetachDataSet();
Hope this helps,
Franck
Le dimanche 07 juin 2009 à 09:35 -0400, gary adams a écrit :
>
>
> I have been using SimpleORM for the last two months and its a great
> tool. I have a question about record caching
>
> If one has static information in the database that he wants to cache
> in an application, like configuration information, what is the proper
> methodology of doing this with simpleORM? The app will need access to
> this information throughout its life.
>
> I have done it likes this.
>
>
>
>
> LIST<x> listX= session.queryNoFlush(queryDEF);
>
> session.commitAndDetachDataSet();
>
>
>
> Is this correct? I am concerned that the commit being done in the
> class that requires the cache will affect other items in the database
> that should not be committed yet.
>
>
>
> Along the same lines, what is the proper way to attaching records to
> a dataset from a rawquery? I have used
>
> session.getDataSet().attach(record), but I am concerned because it is
> deprecated.
>
>
>
> thanks
>
> GA
>
>
>
>
>
> ______________________________________________________________________
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
> Check it out.
>
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/SimpleORM/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/SimpleORM/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/