|
From: Tim K. <tim...@vi...> - 2004-05-27 17:52:49
|
One other solution I thought about with was to use a static class=20 variable for the ids I wanted to access, and have them set in the=20 execute() method, then they'd be useable in the RowMapper instance, but=20= however that would require defining the bean as a prototype in the=20 applicationContext.xml file, to get around the thread safety issue -=20 this also pretty much defeats the purpose of having a threadsafe=20 StoredProcedure object. So any solution that can be come up w/ to solve this kind of need would=20= be greatly appreciated, and I think others will have a use for this as=20= well, especially with PreparedStatements as well for us too. I only=20 wish I had the kind of inner understanding of the spring basics to be=20 able to code up some ideas, but as it is, you guys are so far ahead of=20= me design-wise, I'm still playing catch-up here. -tim On May 27, 2004, at 12:35 PM, j=9Frgen h=9Aller [werk3AT] wrote: > That's true: If you need access to input parameters, you need to have=20= > a separate RowMapper instance per execution, which again leads to the=20= > need for a separate StoredProcedure instance per execution. > > One way to make this work with a reusable StoredProcedure instance=20 > could be to introduce a "RowMapperWithParameters" interface that=20 > passes in the stored procedure parameters as argument of the mapRow=20 > method (analogous to MappingSqlQuery and=20 > MappingSqlQueryWithParameters). Such a RowMapperWithParameters could=20= > potentially also make sense for PreparedStatements. > > Thomas, what do you think? > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On = Behalf > Of Tim Kettering > Sent: Thursday, May 27, 2004 5:33 PM > To: spr...@li... > Subject: Stored Procedure support (was Re: [Springframework-developer] > Preparing for 1.0.2) > > > > Hi Juergen, > > I brought up an question on this list a while ago about the > StoredProcedure object, and if there were a way to safely access > outside variables in the RowMapper instance, like for instance in a > StoredProcedure object that I played aruond with, it worked great as a > replacement for the older one I wrote before with one exception. = There > was a particular place where i relied on a value (a user id) for one = of > the parameters of the procedure, and there didnt seem to be a > threadsafe way to make it available (getting the value from the > parameter Map) in the RowMapper, or at least as far as my knowledge of > java goes. > > So I was wondering if you had seen that email and if there's something > I'm missing here? The only solution I could think of was to actually > set up the sql to place that value as a column so it'd be accessible > from the ResultSet, but I was hoping to avoid having to do that. > > thanks in advance, > > -tim > > > On May 27, 2004, at 10:53 AM, j=9Frgen h=9Aller [werk3AT] wrote: > >> Thomas, >> >> Any chance to review the JDBC changes today, in particular testing >> whether the stored procedure stuff still works as expected? I do = trust >> unit test suites, but well, you know :-) >> >> Note that there's also an adapted version of imagedb's >> DefaultImageDatabase in CVS, illustrating the use of a RowMapper with >> JdbcTemplate rather than a MappingSqlQuery operation object. >> >> BTW, I'm currently working on Quartz JDBCJobStore integration with >> Spring, for a werk3AT project. This won't make it into Spring 1.0.2, >> though. If anyone has already prototyped in that direction, please = let >> me know! >> >> Juergen >> >> >> -----Original Message----- >> From: spr...@li... >> [mailto:spr...@li...]On=20 >> Behalf >> Of j=9Frgen h=9Aller [werk3AT] >> Sent: Thursday, May 27, 2004 10:34 AM >> To: spr...@li... >> Subject: Re: [Springframework-developer] Preparing for 1.0.2 >> >> >> Oh well, time schedules and my perfectionism... >> >> I've done some further polishing, committed yesterday morning >> respectively today: >> >> - I've factored out RowMapperResultReader from SqlParameter, to make >> RowMapper usable for plain JDBC queries too >> - JdbcTemplate.call respectively StoredProcedure supports >> ResultSetExtractor as output parameter too >> - I've slightly refactored JdbcTemplate.call's implementation to = allow >> for a higher level of code reuse >> >> - AbstractAutowireCapableBeanFactory catches Throwable on bean >> creation, rethrowing it as meaningful BeanCreationException >> - DefaultListableBeanFactory.preInstantiateSingletons cleans up >> already created singletons if it fails >> - XmlViewResolver and ResourceBundleViewResolver clean up their view >> bean factories on context shutdown >> >> Thomas, it would be great if you had a chance to review the JDBC >> changes, and maybe run a couple of integration tests with stored >> procedures - to make sure that I haven't broken anything, even if the >> test suite passes. >> >> As there haven't been any reports on problems with the garbage >> collection changes, I plan to go ahead and finalize 1.0.2 for >> tomorrow. >> >> Juergen >> >> >> ________________________________ >> >> Von: spr...@li... im Auftrag >> von j=9Frgen h=9Aller [werk3AT] >> Gesendet: Mi 26.05.2004 07:38 >> An: spr...@li... >> Betreff: Re: [Springframework-developer] Preparing for 1.0.2 >> >> >> >> There hasn't been any change in AbstractXsltView since 1.0 final, so = I >> guess this is usual behavior... >> >> BTW, current planned release date: tonight! I know, I know - this = time >> for real, provided that there's no showstopper :-) >> >> Juergen >> >> >> ________________________________ >> >> Von: spr...@li... im Auftrag >> von Darren Davison >> Gesendet: Mi 26.05.2004 01:40 >> An: spr...@li... >> Betreff: Re: [Springframework-developer] Preparing for 1.0.2 >> >> >> >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On Wednesday 26 May 2004 00:27, Darren Davison wrote: >> >>> AbstractXsltView (line 143) shown below is throwing a >>> TransformerConfigurationException. The stylesheet is correctly=20 >>> loaded >>> and appears valid whether loaded from a servlet context resource or = a >>> classpath resource (the 2 I tried). >> >> hmm.. >> >> it seems that removing any <xsl:output> tags in the stylesheets >> themselves >> makes the problem disappear. That strikes me as a bit odd though: = has >> something changed recently in XSL world? I can't find any info on >> this.. >> >> Cheers, >> - -- >> Darren Davison >> Public Key: http://www.davison.uk.net/pages/key.htm >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.2.4 (GNU/Linux) >> >> iD8DBQFAs9l7KLMLAN01aw0RAgFCAJ97NbqA547fyx6rCQLiSXkCUFWreQCghOiD >> Tle6ycCFcmn5hNf2ZLZznX0=3D >> =3D4YWT >> -----END PGP SIGNATURE----- >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: Oracle 10g >> Get certified on the hottest thing ever to hit the market... Oracle >> 10g. >> Take an Oracle 10g class now, and we'll give you the exam FREE. >> http://ads.osdn.com/?ad_id149&alloc_id=FA66&op=3Dick >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> = https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: Oracle 10g >> Get certified on the hottest thing ever to hit the market... Oracle >> 10g. >> Take an Oracle 10g class now, and we'll give you the exam FREE. >> http://ads.osdn.com/?ad_id149&alloc_id=FA66&op=3Dick >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> = https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: Oracle 10g >> Get certified on the hottest thing ever to hit the market... Oracle >> 10g. >> Take an Oracle 10g class now, and we'll give you the exam FREE. >> http://ads.osdn.com/?ad_id149&alloc_id=FA66&op=3Dick >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> = https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: Oracle 10g >> Get certified on the hottest thing ever to hit the market... Oracle >> 10g. >> Take an Oracle 10g class now, and we'll give you the exam FREE. >> http://ads.osdn.com/?ad_id149&alloc_id=FA66&op=3Dclick >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> = https://lists.sourceforge.net/lists/listinfo/springframework-developer >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle=20 > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id=AA66&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle=20 > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id=AA66&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |