views:

34

answers:

1

I'm trying to begin a transaction however on calling the .Begin() method throws a NullReferenceException and the stacktrace shows that it is coming from IBMU2.UODOTNET.UniTransaction.ServerTransaction(Int32 aKey).

Has anyone successfully used UniTransaction, if so is there something that i'm missing?

// note: Session is already connected 
// and can do UniFile operations prior to this point.

UniTransaction transaction = session.CreateUniTransaction();
transaction.Begin(); // throws NullReferenceException

Note: The system is a UniData system and not a UniVerse system. Not sure if that makes a difference.

A: 

Are you able to supply more code?

As a start, maybe moving the session.CreateUniTransaction before you do the session.CreateUniFile.

Not sure if it will help (because we are currently using the COM UniObjects not the .NET library), but that is how they have it in the example in uonet.pdf

Dan McGrath
the only other code is the login, password, and the connect call for the unisession object. after that i just use the above code and it throws the error. I'm thinking it is a UniData issue. Could it be that our version of UniData doesn't support transactions? or only UniVerse can support transactions?
thames
UniData supports transactions from v6 if I recall correctly.
Dan McGrath
Hmmm. I'll do some checking. We are using v6. Maybe it needs to be turned on or is a config setting in UniData?
thames