Sorry I don't know how to fix your problem but I do have some comments. It looks like your DAO class has a bunch of static methods. It's better to have your DAOs be singletons and be created with a DaoFactory. This allows various DAO implementations to be plugged in later. You lose this benefit when using static methods.

David






From: "Jerry Jalenak" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: [OT] Updating CachedRowSet
Date: Tue, 26 Nov 2002 13:46:19 -0600

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
[EMAIL PROTECTED]


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: [EMAIL PROTECTED]



--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to