So I have been doing a bit of reading about the Data Mapper pattern and I mostly understand how it works. But there is one area I don't quite understand and that is how to make a transaction work with multiple mappers. For example I have two classes (Object1 and Object2) and their corresponding data mappers (Object1Mapper and Object2Mapper) and they are mapped two two database tables. When I want to perform a particular action I need to update both of those objects but I need to do that in a transaction to make sure both of those SQL statements succeed. I am not sure how to go about doing that. I should mention that this isn't for any particular project. I am just trying to understand this pattern a little better and broaden my knowledge. Does anyone know how to do this? Thanks.![]()





Bookmarks