c# - "Value cannot be null" when invoking method decorated with [Autocomplete] -
i have windows forms application (.net 3.5) deployed clickonce-technology , used approximately 50-100 concurrent users. target same ms sql database (sql server 2008 r2) hosted externally.
the application uses "wrapper"-class perform database queries. class derives servicedcomponent , decorates methods [autocomplete] attribute. below example:
[serializable] [transaction(transactionoption.required, isolation=transactionisolationlevel.readcommitted)] public class ctxgreenfee374processor: servicedcomponent { public ctxgreenfee374processor() { } [autocomplete] internal season saveseason(callcontext callcontext, season season) { return new pgreenfee374processor().saveseason(callcontext, season); } }
most of time approach works charm. numerous times day following exception occur when method gets invoked (of course there similar methods exact problem):
system.argumentnullexception value cannot null. server stack trace: @ system.threading.monitor.enter(object obj) @ system.data.providerbase.dbconnectionpool.transactedconnectionpool.transactionended(transaction transaction, dbconnectioninternal transactedobject) @ system.data.providerbase.dbconnectionpool.transactionended(transaction transaction, dbconnectioninternal transactedobject) @ system.data.providerbase.dbconnectioninternal.cleanupconnectionontransactioncompletion(transaction transaction) @ system.data.sqlclient.sqldelegatedtransaction.singlephasecommit(singlephaseenlistment enlistment) @ system.transactions.transactionstatedelegatedcommitting.enterstate(internaltransaction tx) @ system.transactions.transactionstatedelegated.begincommit(internaltransaction tx, boolean asynccommit, asynccallback asynccallback, object asyncstate) @ system.transactions.committabletransaction.commit() @ system.enterpriseservices.transactionproxy.commit(guid guid) @ system.runtime.interopservices.marshal.throwexceptionforhrinternal(int32 errorcode, intptr errorinfo) @ system.enterpriseservices.thunk.callback.docallback(object otp, imessage msg, intptr ctx, boolean fisautodone, memberinfo mb, boolean bhasgit) @ system.enterpriseservices.servicedcomponentproxy.crossctxinvoke(imessage reqmsg) @ system.enterpriseservices.servicedcomponentproxy.invoke(imessage request) @ system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type) @ golfit.businessprocess.economics.ctxgreenfee374processor.saveseason(callcontext callcontext, season season) @ golfit.businessprocess.economics.greenfee374processor.saveseason(callcontext callcontext, season season) in c:\projekt\golfit\developmentprod374\businessprocess\golfit.businessprocess.economics\greenfee374\greenfee374processor.cs:line 104 @ system.runtime.remoting.messaging.stackbuildersink._privateprocessmessage(intptr md, object[] args, object server, int32 methodptr, boolean fexecuteincontext, object[]& outargs) @ system.runtime.remoting.messaging.stackbuildersink.privateprocessmessage(runtimemethodhandle md, object[] args, object server, int32 methodptr, boolean fexecuteincontext, object[]& outargs) @ system.runtime.remoting.messaging.stackbuildersink.syncprocessmessage(imessage msg, int32 methodptr, boolean fexecuteincontext) exception rethrown @ [0]: @ system.runtime.remoting.proxies.realproxy.handlereturnmessage(imessage reqmsg, imessage retmsg) @ system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type) @ golfit.businessprocess.economics.greenfee374processor.saveseason(callcontext callcontext, season season) @ golfit.wingui.economics.frmprice374.save(boolean refresh).
as can see method saveseason in ctxgreenfee374processor class mentioned in exception. far can see last trace of code i've written.
my clue exception has [autocomplete] attribute and/or derived servicedcomponent class. conclusion based on i've checked invalid input parameters , no code inside method gets executed before exception. , assume both servicedcomponent class , [autocomplete] attribute performs som kind of logic before method block executes.
i haven't been successful in recreating exception when debugging, due inconsequent occurrences of exeption. i've had depend on logs production application.
if got idea regarding problem extremely appreciated!
Comments
Post a Comment