You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jerry Jalenak <Je...@LABONE.com> on 2002/11/26 20:46:19 UTC

[OT] Updating CachedRowSet

I'm stumped.

In my DAO I return a disconnected CachedRowSet object back to my business
logic level, do some processing, then update the CachedRowSet so I can send
it back to my DAO and update my database.  The code basically looks like
this:

	<snip>
		CachedRowSet crs = new CachedRowSet();
		try {
			crs = DAO.findUserProfile(user);

			.... do stuff ....

			crs.updateString("userInfo", userInfo);
			crs.updateRow();
			crs.setWriter(null);	/* kill the default writer
*/
			crs.acceptChanges();
			DAO.updateUserProfile(crs);
		}
	</snip>

I can print out the updated userInfo and see that it has been changed.  But
when I print out the contents of the 'userInfo' column from the
CachedRowSet, it still has the original values.  I think it has something to
do with not being on the correct row, but all of the doc I can find leads me
to believe that the code above should work.  Does anyone have any ideas why
this doesn't?

TIA!


Jerry Jalenak
Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
jerry.jalenak@labone.com


This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: securityincidentreporting@labone.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] Updating CachedRowSet

Posted by John Bigboote <y0...@yahoo.com>.
--- Jerry Jalenak <Je...@LABONE.com> wrote:
> 
 [...snip...]
> 
> 
> 	crs.updateString("userInfo", userInfo);
> 	crs.updateRow();
> 	crs.setWriter(null);   // kill default writer
>	crs.acceptChanges();
> 

Why are you setting the writer to null?  It's the
RowSetWriter that propagates changes back to the
database...

John


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>