Combined insert/update/delete Transactions for business object lis

G

Guest

Hi, im using CSLA for my business objects. At my data layer tier i loop
through my list of business objects, if the object is new i insert a new
record, if its to be deleted i remove, and if it has changed i update the
details from the object and persist to the database.

Now if i have long list of objects it will take a long to goto the database
for each individual action. I know transactions can be performed for multiple
actions of the same operation (if i wanted to insert a lot of records for
instance), but is it possible to combine the insert/delete/updates into one
single transaction, or do i need to loop through for the individual cases and
create 3 seperate transactions? I could only find ado code for transaction
operations of the same type, any pointer/tips/code would be much appreciated.

Thanks in advance,

Chris
 
R

RobinS

How I handle this is to keep a property in my business object that keeps
track of the state -- if it's an add, change, or delete. I pass this to a
stored procedure, and it checks the property in an IF statement and runs
the appropriate query. This way I have one stored proc, and can just loop
through my records and execute each one.

Robin S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top