|
From: Claus N. <cla...@ho...> - 2006-06-11 00:35:11
|
Hi all, When using default-lazy-init=”true” with the 2.0 M5 release, I find that neither does my PropertyPlaceholderConfigurer’s do its stuff nor does my ApplicationListener’s receive any events as they all did with previous releases. Is this expected behavior? Regards, Claus Nordahl |
|
From: Juergen H. <ju...@in...> - 2006-06-18 23:40:42
|
This is actually expected behavior: lazy-init has stronger effect in Spring 2.0 now, not even loading the affected bean classes until they are explicitly accessed. For an application context's type detection (such as BeanFactoryPostProcessor detection or ApplicationListener detection), we only check beans that allow for eager initialization now (i.e. that are not marked as lazy-init and are not FactoryBeans). Else we'd have to load each and every bean class just to find out those special beans, which would require all bean classes to be present and loadable - and exactly that is what we intend to avoid with the new semantics in the first place. A further goodie enabled by lazy class loading for lazy-init beans is that a PropertyPlaceholderConfigurer can even resolve placeholders in bean class names now, at least for beans marked as lazy-init. So the recommended solution in case of default-lazy-init=true would be to explicitly mark all affected beans (the ones supposed to be autodetected) as lazy-init=false. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Claus Nordahl Sent: Sunday, June 11, 2006 2:26 AM To: spr...@li... Subject: [Springframework-developer] Changed behavior for default-lazy-init="true" in 2.0 M5 Hi all, When using default-lazy-init="true" with the 2.0 M5 release, I find that neither does my PropertyPlaceholderConfigurer's do its stuff nor does my ApplicationListener's receive any events as they all did with previous releases. Is this expected behavior? Regards, Claus Nordahl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2006-06-19 00:01:26
|
I think this makes sense, personally, although it does mean most apps marked with the default lazy init set to true will probably have to have their config tweaked. I guess we need to really emphasize this change in the change docs. Colin On 6/18/2006 7:40 PM, Juergen Hoeller wrote: >This is actually expected behavior: lazy-init has stronger effect in Spring >2.0 now, not even loading the affected bean classes until they are >explicitly accessed. > >For an application context's type detection (such as >BeanFactoryPostProcessor detection or ApplicationListener detection), we >only check beans that allow for eager initialization now (i.e. that are not >marked as lazy-init and are not FactoryBeans). > >Else we'd have to load each and every bean class just to find out those >special beans, which would require all bean classes to be present and >loadable - and exactly that is what we intend to avoid with the new >semantics in the first place. > >A further goodie enabled by lazy class loading for lazy-init beans is that a >PropertyPlaceholderConfigurer can even resolve placeholders in bean class >names now, at least for beans marked as lazy-init. > >So the recommended solution in case of default-lazy-init=true would be to >explicitly mark all affected beans (the ones supposed to be autodetected) as >lazy-init=false. > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...] On Behalf >Of Claus Nordahl >Sent: Sunday, June 11, 2006 2:26 AM >To: spr...@li... >Subject: [Springframework-developer] Changed behavior for >default-lazy-init="true" in 2.0 M5 > >Hi all, > >When using default-lazy-init="true" with the 2.0 M5 release, I find that >neither does my PropertyPlaceholderConfigurer's do its stuff nor does my >ApplicationListener's receive any events as they all did with previous >releases. > >Is this expected behavior? > >Regards, >Claus Nordahl > > > > >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > |
|
From: Erwin V. <erw...@er...> - 2006-06-19 07:09:02
|
Absolutely. Maybe we should have a setting to switch to Spring 1.x lazy-init semantics? Erwin Vervaet erw...@er... ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <spr...@li...> Sent: Monday, June 19, 2006 2:01 AM Subject: Re: [Springframework-developer] Changed behavior for default-lazy-init="true" in 2.0 M5 >I think this makes sense, personally, although it does mean most apps > marked with the default lazy init set to true will probably have to have > their config tweaked. I guess we need to really emphasize this change in > the change docs. > > Colin > > On 6/18/2006 7:40 PM, Juergen Hoeller wrote: > >>This is actually expected behavior: lazy-init has stronger effect in >>Spring >>2.0 now, not even loading the affected bean classes until they are >>explicitly accessed. >> >>For an application context's type detection (such as >>BeanFactoryPostProcessor detection or ApplicationListener detection), we >>only check beans that allow for eager initialization now (i.e. that are >>not >>marked as lazy-init and are not FactoryBeans). >> >>Else we'd have to load each and every bean class just to find out those >>special beans, which would require all bean classes to be present and >>loadable - and exactly that is what we intend to avoid with the new >>semantics in the first place. >> >>A further goodie enabled by lazy class loading for lazy-init beans is that >>a >>PropertyPlaceholderConfigurer can even resolve placeholders in bean class >>names now, at least for beans marked as lazy-init. >> >>So the recommended solution in case of default-lazy-init=true would be to >>explicitly mark all affected beans (the ones supposed to be autodetected) >>as >>lazy-init=false. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...] On Behalf >>Of Claus Nordahl >>Sent: Sunday, June 11, 2006 2:26 AM >>To: spr...@li... >>Subject: [Springframework-developer] Changed behavior for >>default-lazy-init="true" in 2.0 M5 >> >>Hi all, >> >>When using default-lazy-init="true" with the 2.0 M5 release, I find that >>neither does my PropertyPlaceholderConfigurer's do its stuff nor does my >>ApplicationListener's receive any events as they all did with previous >>releases. >> >>Is this expected behavior? >> >>Regards, >>Claus Nordahl >> >> >> >> >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> > > > > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Matt S. <mat...@sp...> - 2006-06-21 21:05:13
|
This also changes the behavior of ListableBeanFactory.getBeansOfType(Class, boolean, false). In Spring 1.x this method would return beans that had lazy-init="true" but in Spring 2.x this method does not reutrn beans with lazy-init="true". This has been the largest source of migration headaches for me in my application. Matt Colin Sampaleanu wrote: > I think this makes sense, personally, although it does mean most apps > marked with the default lazy init set to true will probably have to have > their config tweaked. I guess we need to really emphasize this change in > the change docs. > > Colin > > On 6/18/2006 7:40 PM, Juergen Hoeller wrote: > >> This is actually expected behavior: lazy-init has stronger effect in Spring >> 2.0 now, not even loading the affected bean classes until they are >> explicitly accessed. >> >> For an application context's type detection (such as >> BeanFactoryPostProcessor detection or ApplicationListener detection), we >> only check beans that allow for eager initialization now (i.e. that are not >> marked as lazy-init and are not FactoryBeans). >> >> Else we'd have to load each and every bean class just to find out those >> special beans, which would require all bean classes to be present and >> loadable - and exactly that is what we intend to avoid with the new >> semantics in the first place. >> >> A further goodie enabled by lazy class loading for lazy-init beans is that a >> PropertyPlaceholderConfigurer can even resolve placeholders in bean class >> names now, at least for beans marked as lazy-init. >> >> So the recommended solution in case of default-lazy-init=true would be to >> explicitly mark all affected beans (the ones supposed to be autodetected) as >> lazy-init=false. >> >> Juergen >> >> >> -----Original Message----- >> From: spr...@li... >> [mailto:spr...@li...] On Behalf >> Of Claus Nordahl >> Sent: Sunday, June 11, 2006 2:26 AM >> To: spr...@li... >> Subject: [Springframework-developer] Changed behavior for >> default-lazy-init="true" in 2.0 M5 >> >> Hi all, >> >> When using default-lazy-init="true" with the 2.0 M5 release, I find that >> neither does my PropertyPlaceholderConfigurer's do its stuff nor does my >> ApplicationListener's receive any events as they all did with previous >> releases. >> >> Is this expected behavior? >> >> Regards, >> Claus Nordahl >> >> >> >> >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> |
|
From: Bob L. <cra...@cr...> - 2006-06-30 15:45:43
|
I'm a little new to this. It seems strange to me that you can lazily initialize on a bean-by-bean basis. Don't you want to lazy load everything during development (faster turnaround time on the section of code you're working on) and eagerly load everything in production (consistent performance for users)? Bob On 6/18/06, Juergen Hoeller <ju...@in...> wrote: > > This is actually expected behavior: lazy-init has stronger effect in > Spring > 2.0 now, not even loading the affected bean classes until they are > explicitly accessed. > > For an application context's type detection (such as > BeanFactoryPostProcessor detection or ApplicationListener detection), we > only check beans that allow for eager initialization now (i.e. that are > not > marked as lazy-init and are not FactoryBeans). > > Else we'd have to load each and every bean class just to find out those > special beans, which would require all bean classes to be present and > loadable - and exactly that is what we intend to avoid with the new > semantics in the first place. > > A further goodie enabled by lazy class loading for lazy-init beans is that > a > PropertyPlaceholderConfigurer can even resolve placeholders in bean class > names now, at least for beans marked as lazy-init. > > So the recommended solution in case of default-lazy-init=true would be to > explicitly mark all affected beans (the ones supposed to be autodetected) > as > lazy-init=false. > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf > Of Claus Nordahl > Sent: Sunday, June 11, 2006 2:26 AM > To: spr...@li... > Subject: [Springframework-developer] Changed behavior for > default-lazy-init="true" in 2.0 M5 > > Hi all, > > When using default-lazy-init="true" with the 2.0 M5 release, I find that > neither does my PropertyPlaceholderConfigurer's do its stuff nor does my > ApplicationListener's receive any events as they all did with previous > releases. > > Is this expected behavior? > > Regards, > Claus Nordahl > > > > > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Juergen H. <ju...@in...> - 2006-07-09 01:11:15
|
Lazy initialization on a bean-by-bean basis can for example be used for switching between alternatives based on some placeholder in a bean reference. That said, I generally agree that lazy loading is not used that much in a Spring environment, in particular not in production. And even in development, the startup time of an application context usually doesn't really matter... at least not the Spring side of it. Juergen _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Bob Lee Sent: Friday, June 30, 2006 5:46 PM To: spr...@li... Subject: Re: [Springframework-developer] Changed behavior fordefault-lazy-init="true" in 2.0 M5 I'm a little new to this. It seems strange to me that you can lazily initialize on a bean-by-bean basis. Don't you want to lazy load everything during development (faster turnaround time on the section of code you're working on) and eagerly load everything in production (consistent performance for users)? Bob On 6/18/06, Juergen Hoeller <ju...@in...> wrote: This is actually expected behavior: lazy-init has stronger effect in Spring 2.0 now, not even loading the affected bean classes until they are explicitly accessed. For an application context's type detection (such as BeanFactoryPostProcessor detection or ApplicationListener detection), we only check beans that allow for eager initialization now (i.e. that are not marked as lazy-init and are not FactoryBeans). Else we'd have to load each and every bean class just to find out those special beans, which would require all bean classes to be present and loadable - and exactly that is what we intend to avoid with the new semantics in the first place. A further goodie enabled by lazy class loading for lazy-init beans is that a PropertyPlaceholderConfigurer can even resolve placeholders in bean class names now, at least for beans marked as lazy-init. So the recommended solution in case of default-lazy-init=true would be to explicitly mark all affected beans (the ones supposed to be autodetected) as lazy-init=false. Juergen -----Original Message----- From: spr...@li... [mailto: spr...@li...] On Behalf Of Claus Nordahl Sent: Sunday, June 11, 2006 2:26 AM To: spr...@li... Subject: [Springframework-developer] Changed behavior for default-lazy-init="true" in 2.0 M5 Hi all, When using default-lazy-init="true" with the 2.0 M5 release, I find that neither does my PropertyPlaceholderConfigurer's do its stuff nor does my ApplicationListener's receive any events as they all did with previous releases. Is this expected behavior? Regards, Claus Nordahl _______________________________________________ Springframework-developer mailing list Spr...@li... <mailto:Spr...@li...> https://lists.sourceforge.net/lists/listinfo/springframework-developer _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: epere4 <ep...@ya...> - 2006-07-21 00:11:34
|
Juergen Hoeller wrote: > > Lazy initialization on a bean-by-bean basis can for example be used for > switching between alternatives based on some placeholder in a bean > reference. That said, I generally agree that lazy loading is not used that > much in a Spring environment, in particular not in production. And even in > development, the startup time of an application context usually doesn't > really matter... at least not the Spring side of it. > > Juergen > Hello! I disagree, here. It is true that spring's part in startup time will be small, but if the beans you instantiate are a lot or are somehow complex, then you end up waiting for a while until your app completes its starting. I would like to have some way to make spring lazy instantiate *everything* by default (at least at development time). The app in the project I am waiting for has a huge bean's tree and it takes around half a minute to load them all (and when I am developing, I rarely need to use more than a few of these beans at a time). -- View this message in context: http://www.nabble.com/Changed-behavior-for-default-lazy-init%3Dtrue-in-2.0-M5-tf1768373.html#a5426543 Sent from the springframework-developer forum at Nabble.com. |
|
From: Matt S. <mat...@sp...> - 2006-07-21 13:39:18
|
default-lazy-init="true" There's your solution :) Matt epere4 wrote: > > Juergen Hoeller wrote: >> Lazy initialization on a bean-by-bean basis can for example be used for >> switching between alternatives based on some placeholder in a bean >> reference. That said, I generally agree that lazy loading is not used that >> much in a Spring environment, in particular not in production. And even in >> development, the startup time of an application context usually doesn't >> really matter... at least not the Spring side of it. >> >> Juergen >> > > Hello! > > I disagree, here. It is true that spring's part in startup time will be > small, but if the beans you instantiate are a lot or are somehow complex, > then you end up waiting for a while until your app completes its starting. > > I would like to have some way to make spring lazy instantiate *everything* > by default (at least at development time). The app in the project I am > waiting for has a huge bean's tree and it takes around half a minute to load > them all (and when I am developing, I rarely need to use more than a few of > these beans at a time). > > |
|
From: Eduardo P. I. <ep...@gm...> - 2006-07-21 14:27:30
|
But you have to set that in every bean file, am I right? Is there a way to globaly define it, for example by setting a property? I would like something like --Dorg.springframework.default-lazy-init=true Thanks! On 7/21/06, Matt Sgarlata <mat...@sp...> wrote: > > default-lazy-init="true" > > There's your solution :) > > Matt > > epere4 wrote: > > > > Juergen Hoeller wrote: > >> Lazy initialization on a bean-by-bean basis can for example be used for > >> switching between alternatives based on some placeholder in a bean > >> reference. That said, I generally agree that lazy loading is not used > that > >> much in a Spring environment, in particular not in production. And even > in > >> development, the startup time of an application context usually doesn't > >> really matter... at least not the Spring side of it. > >> > >> Juergen > >> > > > > Hello! > > > > I disagree, here. It is true that spring's part in startup time will be > > small, but if the beans you instantiate are a lot or are somehow > complex, > > then you end up waiting for a while until your app completes its > starting. > > > > I would like to have some way to make spring lazy instantiate > *everything* > > by default (at least at development time). The app in the project I am > > waiting for has a huge bean's tree and it takes around half a minute to > load > > them all (and when I am developing, I rarely need to use more than a few > of > > these beans at a time). > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Bob W. <bw...@po...> - 2006-07-21 20:48:25
|
No, you define it at the root level and it applies to any bean which doesn't specifically specify lazy init: <beans default-lazy-init='true'> Bob Eduardo Pereda IV wrote: > But you have to set that in every bean file, am I right? Is there a > way to globaly define it, for example by setting a property? > I would like something like --Dorg.springframework.default-lazy-init=true > > Thanks! > > > On 7/21/06, *Matt Sgarlata* <mat...@sp... > <mailto:mat...@sp...>> wrote: > > default-lazy-init="true" > > There's your solution :) > > Matt > > epere4 wrote: > > > > Juergen Hoeller wrote: > >> Lazy initialization on a bean-by-bean basis can for example be > used for > >> switching between alternatives based on some placeholder in a bean > >> reference. That said, I generally agree that lazy loading is > not used that > >> much in a Spring environment, in particular not in production. > And even in > >> development, the startup time of an application context usually > doesn't > >> really matter... at least not the Spring side of it. > >> > >> Juergen > >> > > > > Hello! > > > > I disagree, here. It is true that spring's part in startup time > will be > > small, but if the beans you instantiate are a lot or are somehow > complex, > > then you end up waiting for a while until your app completes its > starting. > > > > I would like to have some way to make spring lazy instantiate > *everything* > > by default (at least at development time). The app in the > project I am > > waiting for has a huge bean's tree and it takes around half a > minute to load > > them all (and when I am developing, I rarely need to use more > than a few of > > these beans at a time). > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn > cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > <mailto:Spr...@li...> > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |