<?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: Running CFGroovy on in a Hibernate-Aware Environment</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: denny</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175802</link>
		<dc:creator>denny</dc:creator>
		<pubDate>Thu, 30 Apr 2009 18:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175802</guid>
		<description>I was thinking the pre-compiled entities would only be pre-compiled for the groovyLoader, not for the application as a whole, so you could re-compile and re-load on the fly.

I had some relative success doing that for Hibernate alone, in a classloader, so as to get the &quot;on the fly&quot; loveliness.  I was doing a lot with the entity-based hibernate objects (hashmaps), to get a lot of dynamicalness out of it, too.  Haven&#039;t decided which is better... hibernate is basically a whole framework-ish-deal, when you get really into it-- but then your model is hibernate-based, which might kinda suck sometimes...

I was thinking the groovyLoader, being designed for crazy classloading, might not have such a rough time with garbage collection and whatnot.  Eh.  

Been experimenting here and there (mostly checking out GORM-without-Grails stuff lately, as it sounds nifty), but I haven&#039;t really messed with a spring-based java model... after all the stuff I&#039;ve seen lately tho, spring is at least as cool as ColdSpring ;-), might not be a bad thing to look into...

If the server isn&#039;t running out of memory while you&#039;re doing all your groovy stuff, then it looks like garbage collection *is* better when using a groovy classloader.... are you sure the reason it&#039;s running out of memory after a while isn&#039;t the URLClassLoader you&#039;re using to put groovy itself into play?

I&#039;ve been doing a lot of load testing lately, guess I can slap some experiments together to see what happens.</description>
		<content:encoded><![CDATA[<p>I was thinking the pre-compiled entities would only be pre-compiled for the groovyLoader, not for the application as a whole, so you could re-compile and re-load on the fly.</p>
<p>I had some relative success doing that for Hibernate alone, in a classloader, so as to get the "on the fly" loveliness.  I was doing a lot with the entity-based hibernate objects (hashmaps), to get a lot of dynamicalness out of it, too.  Haven't decided which is better&#8230; hibernate is basically a whole framework-ish-deal, when you get really into it&#8211; but then your model is hibernate-based, which might kinda suck sometimes&#8230;</p>
<p>I was thinking the groovyLoader, being designed for crazy classloading, might not have such a rough time with garbage collection and whatnot.  Eh.  </p>
<p>Been experimenting here and there (mostly checking out GORM-without-Grails stuff lately, as it sounds nifty), but I haven't really messed with a spring-based java model&#8230; after all the stuff I've seen lately tho, spring is at least as cool as ColdSpring ;-), might not be a bad thing to look into&#8230;</p>
<p>If the server isn't running out of memory while you're doing all your groovy stuff, then it looks like garbage collection *is* better when using a groovy classloader&#8230;. are you sure the reason it's running out of memory after a while isn't the URLClassLoader you're using to put groovy itself into play?</p>
<p>I've been doing a lot of load testing lately, guess I can slap some experiments together to see what happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175724</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Thu, 30 Apr 2009 05:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175724</guid>
		<description>denny,

yep, that&#039;s exactly it.  Unfortunately to get Hibernate to load new stuff, you have to tear it and it&#039;s classloader down each time, and one of the big goals of the Hibernate integration was to avoid having to restart your container every time.  In development I&#039;ve found I usually get 20-30 Hibernate reloads before I run out of PermGen and have to restart the container.  Far from ideal, but way better than having to restart every time.  And since it&#039;s not a factor in production (where you&#039;re not modifying files), I&#039;ve deemed it &quot;ok enough&quot; to this point.

I haven&#039;t tried pre-compiled entities, but if you&#039;ve got those, why not just use Spring (or a Configuration directly)?  CFGroovy&#039;s stuff isn&#039;t going to buy you much, except for less flexibility.  :)  Behind the scenes, CFGroovy just compiles all your Groovy entities into .class files and loads them as if they were pre-compiled.  The magic is in the ability to do it repeatedly without restarting the container.</description>
		<content:encoded><![CDATA[<p>denny,</p>
<p>yep, that's exactly it.  Unfortunately to get Hibernate to load new stuff, you have to tear it and it's classloader down each time, and one of the big goals of the Hibernate integration was to avoid having to restart your container every time.  In development I've found I usually get 20-30 Hibernate reloads before I run out of PermGen and have to restart the container.  Far from ideal, but way better than having to restart every time.  And since it's not a factor in production (where you're not modifying files), I've deemed it "ok enough" to this point.</p>
<p>I haven't tried pre-compiled entities, but if you've got those, why not just use Spring (or a Configuration directly)?  CFGroovy's stuff isn't going to buy you much, except for less flexibility.  :)  Behind the scenes, CFGroovy just compiles all your Groovy entities into .class files and loads them as if they were pre-compiled.  The magic is in the ability to do it repeatedly without restarting the container.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: denny</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175544</link>
		<dc:creator>denny</dc:creator>
		<pubDate>Tue, 28 Apr 2009 22:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175544</guid>
		<description>Using a URL classloader that&#039;s not in the server scope generally leads to threads that cannot be garbage collected... dunno if that&#039;s part of what&#039;s going on, but it&#039;s a possibility, maybe.

I think the problem with Hibernate is that it uses the thread local context or whatever, and you&#039;re swapping the thread contexts around with the classloading, so the context that loads Hibernate isn&#039;t the same one using it (or something like that perhaps).

I&#039;m pretty sure I&#039;ve gotten hibernate to load in a classloader (had to be real careful that it didn&#039;t go &quot;outside&quot;, like for dom4j (to read config.xml -- I think I used properties instead)), so IIRC, it&#039;s doable, at least.

Had any luck using pre-compiled entities?</description>
		<content:encoded><![CDATA[<p>Using a URL classloader that's not in the server scope generally leads to threads that cannot be garbage collected&#8230; dunno if that's part of what's going on, but it's a possibility, maybe.</p>
<p>I think the problem with Hibernate is that it uses the thread local context or whatever, and you're swapping the thread contexts around with the classloading, so the context that loads Hibernate isn't the same one using it (or something like that perhaps).</p>
<p>I'm pretty sure I've gotten hibernate to load in a classloader (had to be real careful that it didn't go "outside", like for dom4j (to read config.xml &#8212; I think I used properties instead)), so IIRC, it's doable, at least.</p>
<p>Had any luck using pre-compiled entities?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175520</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Tue, 28 Apr 2009 19:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175520</guid>
		<description>In the very early releases, scriptlets were really seamless.  You just dropped the JAR, imported the taglib and went for it.  In order to get Hibernate to work, I had to make some internal changes so while you can still use scriptlets that way, you really want to use a managed runtime.  Doing it without a managed runtime causes performance issues and can deplete PermGen.  Fixing that, without sacrificing Hibernate, is the top priority.

More specifically, importing the taglib and running it should be production worthy without any additional configuration.  If you want custom classloading, Hibernate, etc., then you have to do config work, but for the base use (scriptlets) it should be 100% transparent.</description>
		<content:encoded><![CDATA[<p>In the very early releases, scriptlets were really seamless.  You just dropped the JAR, imported the taglib and went for it.  In order to get Hibernate to work, I had to make some internal changes so while you can still use scriptlets that way, you really want to use a managed runtime.  Doing it without a managed runtime causes performance issues and can deplete PermGen.  Fixing that, without sacrificing Hibernate, is the top priority.</p>
<p>More specifically, importing the taglib and running it should be production worthy without any additional configuration.  If you want custom classloading, Hibernate, etc., then you have to do config work, but for the base use (scriptlets) it should be 100% transparent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Ho</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175519</link>
		<dc:creator>Henry Ho</dc:creator>
		<pubDate>Tue, 28 Apr 2009 19:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175519</guid>
		<description>seamless scriptlets? oh, I thought it is already implemented... What does it do? :)

Hmm... I just don&#039;t want my app to be broken when upgraded to CF9.  Hope things will work out better later.</description>
		<content:encoded><![CDATA[<p>seamless scriptlets? oh, I thought it is already implemented&#8230; What does it do? :)</p>
<p>Hmm&#8230; I just don't want my app to be broken when upgraded to CF9.  Hope things will work out better later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175517</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Tue, 28 Apr 2009 19:17:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175517</guid>
		<description>Henry,

Yeah, that&#039;s the gist of it.  You can use CFGroovy on CF9 without issue, but you can&#039;t use the HibernatePlugin on CF9 unless you delete the Hibernate JAR from the CF classpath, breaking the in-build CF9 Hibernate stuff.  It seems unlikely that you&#039;d want to use both CFGroovy&#039;s Hibernate and the in-built stuff on a single CF9 instance, so I&#039;m not sure how much of a problem it&#039;d be in real life, but certainly undesirable.

I hope I can deal with this issue in the future (since it affects JBoss 5 as well), but right now it&#039;s a couple items down the list.  First priority is resurrecting seamless scriptlets, since that seems to be the bigger long-term win, as well as the original objective.</description>
		<content:encoded><![CDATA[<p>Henry,</p>
<p>Yeah, that's the gist of it.  You can use CFGroovy on CF9 without issue, but you can't use the HibernatePlugin on CF9 unless you delete the Hibernate JAR from the CF classpath, breaking the in-build CF9 Hibernate stuff.  It seems unlikely that you'd want to use both CFGroovy's Hibernate and the in-built stuff on a single CF9 instance, so I'm not sure how much of a problem it'd be in real life, but certainly undesirable.</p>
<p>I hope I can deal with this issue in the future (since it affects JBoss 5 as well), but right now it's a couple items down the list.  First priority is resurrecting seamless scriptlets, since that seems to be the bigger long-term win, as well as the original objective.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Ho</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-175516</link>
		<dc:creator>Henry Ho</dc:creator>
		<pubDate>Tue, 28 Apr 2009 19:12:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-175516</guid>
		<description>Does that mean I cannot use CF9&#039;s hibernate features together with cfgroovy + hibernate in the future?</description>
		<content:encoded><![CDATA[<p>Does that mean I cannot use CF9's hibernate features together with cfgroovy + hibernate in the future?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-171226</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Mon, 06 Apr 2009 03:26:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-171226</guid>
		<description>denny,

Yeah, entirely possible.  I&#039;ve never used JBoss for anything.  The issue with classloading is that Hibernate and the entity classes have to be loaded in the SAME classloader.  So if Hibernate is already loaded anywhere, CFGroovy can&#039;t hope to work, since the entity classes don&#039;t exist until CFGroovy gets it&#039;s hands on them.</description>
		<content:encoded><![CDATA[<p>denny,</p>
<p>Yeah, entirely possible.  I've never used JBoss for anything.  The issue with classloading is that Hibernate and the entity classes have to be loaded in the SAME classloader.  So if Hibernate is already loaded anywhere, CFGroovy can't hope to work, since the entity classes don't exist until CFGroovy gets it's hands on them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: denny</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-171158</link>
		<dc:creator>denny</dc:creator>
		<pubDate>Sun, 05 Apr 2009 19:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-171158</guid>
		<description>Hmm... I&#039;m pretty sure that the clustering and cache stuff is like a level above WAR and EAR deployment... I&#039;m pretty sure JBoss itself is doing things with hibernate, before it ever tries to fire up WARs and such (at least if you&#039;re using clustering and cache whatnots).

And, other apps can include hibernate and work, so I think that the main problem is how the classloading/dynamic stuff is resolving things, or some such.

Changing to a child first classloading deal for the EAR I have railo in doesn&#039;t do anything different for cfgroovy, but cfgroovy isn&#039;t being deployed the way a WAR or EAR would be, so... eh.

&#039;course, there&#039;s always the route of compiling the model sources first, and including them while loading hibernate; which probably wouldn&#039;t be too bad, as that&#039;s sorta what happens anyways...  eh*2.

It might have taken me 8 years or so to figure out how to include commons-logging without messing up other applications, but I did it.  This seems similar, but not as inherently broken, so hopefully in like 4 or so, perhaps 6 to be safe... :-)</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; I'm pretty sure that the clustering and cache stuff is like a level above WAR and EAR deployment&#8230; I'm pretty sure JBoss itself is doing things with hibernate, before it ever tries to fire up WARs and such (at least if you're using clustering and cache whatnots).</p>
<p>And, other apps can include hibernate and work, so I think that the main problem is how the classloading/dynamic stuff is resolving things, or some such.</p>
<p>Changing to a child first classloading deal for the EAR I have railo in doesn't do anything different for cfgroovy, but cfgroovy isn't being deployed the way a WAR or EAR would be, so&#8230; eh.</p>
<p>'course, there's always the route of compiling the model sources first, and including them while loading hibernate; which probably wouldn't be too bad, as that's sorta what happens anyways&#8230;  eh*2.</p>
<p>It might have taken me 8 years or so to figure out how to include commons-logging without messing up other applications, but I did it.  This seems similar, but not as inherently broken, so hopefully in like 4 or so, perhaps 6 to be safe&#8230; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/03/23/running-cfgroovy-on-in-a-hibernate-aware-environment/comment-page-1/#comment-171048</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Sun, 05 Apr 2009 03:16:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=760#comment-171048</guid>
		<description>denny,

Yeah, if you remove it from the server, it won&#039;t be available to any applications.  But that shouldn&#039;t prevent you from adding it to the applications that needed.  You just can&#039;t have the server providing it to ALL applications.  That&#039;s really the way you want to be doing it anyway so that each app can depend on its own version of Hibernate and upgrade separately from everything else.</description>
		<content:encoded><![CDATA[<p>denny,</p>
<p>Yeah, if you remove it from the server, it won't be available to any applications.  But that shouldn't prevent you from adding it to the applications that needed.  You just can't have the server providing it to ALL applications.  That's really the way you want to be doing it anyway so that each app can depend on its own version of Hibernate and upgrade separately from everything else.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
