Oskar,

Thanks for the reply.  The Enlist method seems to allow you to insert
a new command in the current transaction, but it also seems to behave
differently than the same command given through cmd.ExcuteNonQuery().

For example, I have the code:

--------------------------------------------------------
string block = "BEGIN " +
                     "UPDATE rpt_source set body = empty_blob() where
source_id = :1;" +
                     "SELECT body into :2 from rpt_source where
source_id = :3 FOR UPDATE; " +
                     "END;";
IDbCommand cmd = conn.CreateCommand();
cmd.CommandText = block;
cmd.CommandType = CommandType.Text;

IDbDataParameter param = null;
                        // The source id to use for the update.
                        param = cmd.CreateParameter();
                        param.Direction = ParameterDirection.Input;
                        param.DbType = DbType.VarNumeric;
                        param.ParameterName = "1";
                        param.Value = src.SourceId;
                        cmd.Parameters.Add(param);

                        // The body column object to add the data.
                        param = cmd.CreateParameter();
                        param.Direction = ParameterDirection.Output;
                        param.DbType = DbType.Object;
                        param.ParameterName = "2";
                        cmd.Parameters.Add(param);

                        // The source id to use for the query.
                        param = cmd.CreateParameter();
                        param.Direction = ParameterDirection.Input;
                        param.DbType = DbType.VarNumeric;
                        param.ParameterName = "3";
                        param.Value = src.SourceId;
                        cmd.Parameters.Add(param);

                        // Add the command to the current transaction.
                        session.Transaction.Enlist(cmd);
------------------------------------

When I go to retrieve the blob parameter object via:

var op = cmd.Parameters[1] as OracleParameter;

The op.Value is null.  If have the exact same code but use the
cmd.ExecuteNoNQuery() within a separate transaction, however, my
op.Value is an OracleLob object.

I don't know why this is but it seems clear that I am not getting the
result I thought I would.  Do you have any ideas about why this is?
Maybe it is a timing issue within the transaction as to what is
available.

Thoughts?

Thanks - Peter


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to