<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Even More ActiveObjects: Preloading</title>
	<atom:link href="http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Mon, 09 Jan 2012 20:21:24 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2412</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Thu, 18 Oct 2007 14:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2412</guid>
		<description>Adding &quot;@Preload(&quot;*&quot;)&quot; to every entity should effectively disable lazy-loading.  Oddly enough, using Query.select(&quot;*&quot;) should have worked fine for that particular query.  This probably means I need to fix a bug somewhere...

Incidentally, if you&#039;re working with DataView, you should probably also take advantage of Query&#039;s pagination feature (Query#limit(int).offset(int)).  This will add additional efficiency to the display algorithm.  Eventually, this sort of functionality will be handled for you in the wicket integration project, but for the moment you&#039;ll have to do it yourself.</description>
		<content:encoded><![CDATA[<p>Adding &#8220;@Preload(&#8220;*&#8221;)&#8221; to every entity should effectively disable lazy-loading.  Oddly enough, using Query.select(&#8220;*&#8221;) should have worked fine for that particular query.  This probably means I need to fix a bug somewhere&#8230;</p>
<p>Incidentally, if you&#8217;re working with DataView, you should probably also take advantage of Query&#8217;s pagination feature (Query#limit(int).offset(int)).  This will add additional efficiency to the display algorithm.  Eventually, this sort of functionality will be handled for you in the wicket integration project, but for the moment you&#8217;ll have to do it yourself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tohkawa</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2411</link>
		<dc:creator>tohkawa</dc:creator>
		<pubDate>Thu, 18 Oct 2007 07:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2411</guid>
		<description>I want the way to switch the lazy-loading and pre-loading (with _all_ columns).

Is there any way to omit (all) column names with Query.select? I tried Query.select(&quot;*&quot;) but didn&#039;t work.

I think it is necesary to disable lazy-loading when using combined with Wicket/DataView because numerous selects (col*row times) occurrs with lazy-loading.</description>
		<content:encoded><![CDATA[<p>I want the way to switch the lazy-loading and pre-loading (with _all_ columns).</p>
<p>Is there any way to omit (all) column names with Query.select? I tried Query.select(&#8220;*&#8221;) but didn&#8217;t work.</p>
<p>I think it is necesary to disable lazy-loading when using combined with Wicket/DataView because numerous selects (col*row times) occurrs with lazy-loading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daniel</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2336</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Mon, 24 Sep 2007 17:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2336</guid>
		<description>Batch saving is an interesting idea that I might look into later.  The thing is you really wouldn&#039;t be saving too much by doing your saves in batch.  In fact, the only difference is there would only be a single Connection opened, rather than dozens opened and closed in quick succession.  The use of a connection pool works around this problem in a more transparent way.

Batch creating is a more interesting thing to look at, since some databases support an &quot;INSERT INTO blah (id,value) VALUES (?,?),(?,?)&quot; syntax; allowing the insertion of multiple rows in a single statement.  The problem is, this isn&#039;t supported by very many databases (it&#039;s not part of the ANSI standard), so you wouldn&#039;t see a performance gain across the board.</description>
		<content:encoded><![CDATA[<p>Batch saving is an interesting idea that I might look into later.  The thing is you really wouldn&#8217;t be saving too much by doing your saves in batch.  In fact, the only difference is there would only be a single Connection opened, rather than dozens opened and closed in quick succession.  The use of a connection pool works around this problem in a more transparent way.</p>
<p>Batch creating is a more interesting thing to look at, since some databases support an &#8220;INSERT INTO blah (id,value) VALUES (?,?),(?,?)&#8221; syntax; allowing the insertion of multiple rows in a single statement.  The problem is, this isn&#8217;t supported by very many databases (it&#8217;s not part of the ANSI standard), so you wouldn&#8217;t see a performance gain across the board.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2335</link>
		<dc:creator>Oleg</dc:creator>
		<pubDate>Mon, 24 Sep 2007 17:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2335</guid>
		<description>Daniel,

This looks great. I am going to use AO as my ORM; hopefully, you will have a stable release by the time I&#039;ll need to have a stable release myself. :)

On to the blog post topic: pre-loading is great. My app needs it in spades to trade some start-up time for better performance later. 

However, what about batch saves? My app almost always gets new objects in batches of 10-1000. We also profiled behavior of our users, and they tend to batch their work and submit 50-100 items at a time, even though they can get each item processed immediately.</description>
		<content:encoded><![CDATA[<p>Daniel,</p>
<p>This looks great. I am going to use AO as my ORM; hopefully, you will have a stable release by the time I&#8217;ll need to have a stable release myself. <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>On to the blog post topic: pre-loading is great. My app needs it in spades to trade some start-up time for better performance later. </p>
<p>However, what about batch saves? My app almost always gets new objects in batches of 10-1000. We also profiled behavior of our users, and they tend to batch their work and submit 50-100 items at a time, even though they can get each item processed immediately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daniel</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2121</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Tue, 14 Aug 2007 16:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2121</guid>
		<description>Oh crud, I know what&#039;s doing that!  No wonder I was so mystified...

The dynamic proxy fires a PropertyChangeListener for every changed value.  The problem is PropertyChangeEvent requires an old value as well.  I&#039;ll make that code conditional on the value already being cached, to avoid extra database hits.  Thanks for finding this!

In the case of the relations, they&#039;re always lazily loaded, since I haven&#039;t been able to figure out a way to cache them without opening the door to a stale cache and thus inaccurate values.  So, in short, no @OneToMany or @ManyToMany relation is eagerly loadable right now.  Incidentally, if you have any ideas on the caching I welcome them.  :-)</description>
		<content:encoded><![CDATA[<p>Oh crud, I know what&#8217;s doing that!  No wonder I was so mystified&#8230;</p>
<p>The dynamic proxy fires a PropertyChangeListener for every changed value.  The problem is PropertyChangeEvent requires an old value as well.  I&#8217;ll make that code conditional on the value already being cached, to avoid extra database hits.  Thanks for finding this!</p>
<p>In the case of the relations, they&#8217;re always lazily loaded, since I haven&#8217;t been able to figure out a way to cache them without opening the door to a stale cache and thus inaccurate values.  So, in short, no @OneToMany or @ManyToMany relation is eagerly loadable right now.  Incidentally, if you have any ideas on the caching I welcome them.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Marko</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2120</link>
		<dc:creator>David Marko</dc:creator>
		<pubDate>Tue, 14 Aug 2007 11:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2120</guid>
		<description>Also I run following code:
Person p1=getEntityManager().create(Person.class);
p1.setUsername(&quot;davidm&quot;);
p1.setFirstname(&quot;davidm&quot;);
p1.setLastname(&quot;Marko&quot;);
p1.save();

... and this is what I can see. Why so many particular select hits?
14.8.2007 13:39:38 net.java.ao.DatabaseProvider executeInsertReturningKeys
INFO: INSERT INTO person (id) VALUES (DEFAULT)
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter
INFO: SELECT username FROM person WHERE id = ?
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter
INFO: SELECT firstname FROM person WHERE id = ?
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter
INFO: SELECT lastname FROM person WHERE id = ?
14.8.2007 13:39:38 net.java.ao.EntityProxy save
INFO: UPDATE person SET username = ?,firstname = ?,lastname = ? WHERE id = ?</description>
		<content:encoded><![CDATA[<p>Also I run following code:<br />
Person p1=getEntityManager().create(Person.class);<br />
p1.setUsername(&#8220;davidm&#8221;);<br />
p1.setFirstname(&#8220;davidm&#8221;);<br />
p1.setLastname(&#8220;Marko&#8221;);<br />
p1.save();</p>
<p>&#8230; and this is what I can see. Why so many particular select hits?<br />
14.8.2007 13:39:38 net.java.ao.DatabaseProvider executeInsertReturningKeys<br />
INFO: INSERT INTO person (id) VALUES (DEFAULT)<br />
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter<br />
INFO: SELECT username FROM person WHERE id = ?<br />
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter<br />
INFO: SELECT firstname FROM person WHERE id = ?<br />
14.8.2007 13:39:38 net.java.ao.EntityProxy invokeGetter<br />
INFO: SELECT lastname FROM person WHERE id = ?<br />
14.8.2007 13:39:38 net.java.ao.EntityProxy save<br />
INFO: UPDATE person SET username = ?,firstname = ?,lastname = ? WHERE id = ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Marko</title>
		<link>http://www.codecommit.com/blog/java/even-more-activeobjects-preloading/comment-page-1#comment-2119</link>
		<dc:creator>David Marko</dc:creator>
		<pubDate>Tue, 14 Aug 2007 09:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/java/even-more-activeobjects-preloading#comment-2119</guid>
		<description>How this work when we have OneToMany assotiation and I want to include assotitated items in query? e.g.

public interface Person extends Entity {
    public String getName();
    public void setName(String name);
 
    public int getAge();
    public void setAge(int age);

   @OneToMany
   public Cars[] getCars();
}</description>
		<content:encoded><![CDATA[<p>How this work when we have OneToMany assotiation and I want to include assotitated items in query? e.g.</p>
<p>public interface Person extends Entity {<br />
    public String getName();<br />
    public void setName(String name);</p>
<p>    public int getAge();<br />
    public void setAge(int age);</p>
<p>   @OneToMany<br />
   public Cars[] getCars();<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

