ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nguyen, Tom" <Tom.Ngu...@rels.info>
Subject Possible bugs in latest source from SVN
Date Thu, 18 May 2006 21:40:46 GMT
Hi,

 

Possible Bugs:

DBHelperParameterCache give me an exception if I open a Transaction.  It
said something like derived command must participate in the underline
transaction if a transaction is already open for the connection.

 

So I fix it with: (Line 59-80)
IBatisNet.Common.Utilities.DBHelperParameterCache.cs

 

// added Transaction parameter and pass it the transaction from the
session.

 

                        private static IDataParameter[]
DiscoverSpParameterSet(IDalSession session, string spName, bool
includeReturnValueParameter)

                        {

                                    return
InternalDiscoverSpParameterSet(session.DataSource.DbProvider,
session.Connection, spName, includeReturnValueParameter,
session.Transaction);        

                        }

 

                        // .. snip

                        private static IDataParameter[]
InternalDiscoverSpParameterSet(IDbProvider provider,

                                    IDbConnection connection, string
spName, bool includeReturnValueParameter, IDbTransaction transaction)

                        {

                                    using (IDbCommand cmd =
connection.CreateCommand())

                                    {

                if (transaction != null)

                    cmd.Transaction = transaction;

 

 

Also, I've implemented proxy using Aspect# and runs into an issue from
latest source in DotNetObjectDataExchange.cs line 81:

 

If (target.GetType() != _parameterClass) throw new ArgumentException....

 

Since a proxy (target) is the same type as _parameterClass - derived
from, can this be change to the code below or just commented out all
together?

 

if (target.GetType() != _parameterClass &&
!(_parameterClass.IsSubClassOf(target)) ) throw new ...

 

 

 

Feature request:

Can daoFactory have another key, a string type key?  I know, I'm too
lazy to write a new Dao Factory.  I just modified iBatis and piggyback
my key attribute, but would like this implemented as a feature so I
don't have to keep a local build ;)

 

Dao.config

 

            <daoFactory>

                  <dao key="Issue"

                        interface="Rels.ITS.DataAccessObjects.IIssueDao,
Rels.ITS.DataAccessObjects" 

 
implementation="Rels.ITS.DataAccessObjects.IssueDao,
Rels.ITS.DataAccessObjects" />

                  <dao key="IssueNote"

 
interface="Rels.ITS.DataAccessObjects.IIssueNoteDao,
Rels.ITS.DataAccessObjects" 

 
implementation="Rels.ITS.DataAccessObjects.IssueNoteDao,
Rels.ITS.DataAccessObjects" />

                  <dao key="IssueAssignLog"

 
interface="Rels.ITS.DataAccessObjects.IIssueAssignLogDao,
Rels.ITS.DataAccessObjects" 

 
implementation="Rels.ITS.DataAccessObjects.IssueAssignLogDao,
Rels.ITS.DataAccessObjects" />

            </daoFactory>

 

 

Code:

 

IssueDao idao = DaoManager.GetDao("Issue") as IssueDao;

// or the old way which will still work

IssueDao idao = DaoManager.GetDao(typeof(IIssueDao)) as IssueDao;

 

 

 

Thanks,

 

Tom Nguyen


Mime
View raw message