wombat
03-14-2005, 03:56 PM
Hello...
Sorry for my english.
Suppose I have byref classes in .Net Remoting:
class Master
{
private IDBMS _dbms; // it has SqlTransaction Inside
private Detail _detail;
public void Save()
{
// using _dbms to save Data
_detail.Save();
}
}
_dbms is a wrapper class of ADO.NET which both Master and Detail objects need it. I have problem, if I inject _dbms for both Master and Detail objects by using singleton=false, they will have two difference Ado.NET's SqlTransaction for both Master and Detail. But if singleton=true, I think it might have concurrency problem, which share same connection/transaction for every client. (I might be wrong).
Is injection not a good idea in this situation? all I can think now is to: change the calling from
_detail.Save() to _detail.Save(_dbms) and inject singleton=false to only Master. don't know if this is a good idea, any hint?
Sorry for my english.
Suppose I have byref classes in .Net Remoting:
class Master
{
private IDBMS _dbms; // it has SqlTransaction Inside
private Detail _detail;
public void Save()
{
// using _dbms to save Data
_detail.Save();
}
}
_dbms is a wrapper class of ADO.NET which both Master and Detail objects need it. I have problem, if I inject _dbms for both Master and Detail objects by using singleton=false, they will have two difference Ado.NET's SqlTransaction for both Master and Detail. But if singleton=true, I think it might have concurrency problem, which share same connection/transaction for every client. (I might be wrong).
Is injection not a good idea in this situation? all I can think now is to: change the calling from
_detail.Save() to _detail.Save(_dbms) and inject singleton=false to only Master. don't know if this is a good idea, any hint?