It could do this, yes. But I try to only add features, especially ones like this, that expand the testing and support surface of the framework, when there's a clear and pressing need for such a change.
Do you have a scenario where the current two data access models are insufficient?
The DataPortal_XYZ is (more or less) active record. And the object factory enables a data mapper pattern. I think either of them can be used with the repository pattern, though that is probably a lot easier with the object factory approach.
That pretty much covers the current trendy DAL patterns, but I'm always open to discussion around scenarios that might be compelling.
This scenario wouldn’t be served by opening the selector
then. The transaction mode is set before the selector is invoked. The
server-side data portal is actually a pipeline that goes through several steps –
which is necessary because in the Enterprise Services option the data portal
has to actually get your code running inside a COM+ object.
If you want transactional support for Oracle, you might consider
using Enterprise Services (COM+). As I understand it, Oracle has worked with
the distributed transaction standards used by COM+ for a very long time, and
you might have better luck.
I wouldn’t use the InvokeComplete/Exception methods as you
describe in any case. Instead, I’d contain all transaction management in
the DataPortal_XYZ method (insert/update/deleteself/delete). That keeps things
more concise.
You might also look at the Csla.Data.TransactionManager class to
see if it can help you. It is designed to simplify the use of ADO.NET
transaction objects when using the manual transaction option.
From a “change the data portal” viewpoint, what you
really need/want is to be able to provide your own object to manage the data
portal transaction instead of using the three models currently supported. The
only trick there, is that the Transactional attribute is not currently capable
of expressing arbitrary transaction types. I could add “Custom” to
the list, but then someone would come along and say they need multiple custom
options or something…
Rocky
Copyright (c) Marimer LLC