Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by tony.mudd · Oct 03, 2019 at 07:51 AM · treprfarfa-apierror.netexception

.Net System.AccessViolationException when calling OMMProvider.Submit on a RespMsg containing a status.

I have a provider which has multiple clients connecting and each requesting a set of RICs. If they overlap (i.e. the 2nd client requests a RIC that the first client is already watching), and the response was a status message (i.e. a price wasn't available), then I attempt to replay a status message using the method below:
      public OMMSolicitedItemCmd ReplayStatus(RequestToken requestToken, AttribInfo info)
        {
            _manager.LogDebugMessage($@"Sending stored status for {RIC} to {requestToken.Handle}.");
            var attribInfo = info.Clone();
            var respMsg = new RespMsg
            {
                MsgModelType = RDM.MESSAGE_MODEL_TYPES.MMT_MARKET_PRICE,
                RespType = RespMsg.RespTypeEnum.Status,
                RespStatus = RespStatus,
                AttribInfo = attribInfo,
                IndicationMask = 0,
                RespTypeNum = RDM.INSTRUMENT_UPDATE_RESPONSE_TYPES.INSTRUMENT_UPDATE_UNSPECIFIED
            };
            var solItemCmd = new OMMSolicitedItemCmd
            {
                Msg = respMsg,
                RequestToken = requestToken
            };
            return solItemCmd;
        }

The original RespStatus came from an initial message returned to the first client, but it doesn't have a clone() method. All the other properties of the constructed RespMsg are simple types (enums etc) except the AttribInfo (which is freshly cloned).

Sometimes, when one of these messages is submitted to the provider, we get an AccessViolation. Any ideas what is causing this?

Thanks, Tony.

People who like this

0 Show 2
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
wasin.w ♦♦ · Oct 29, 2019 at 04:32 AM 0
Share

Hello @tony.mudd

Did you submit a query via Contact Premium Support yet? If so, could you please share us the ticket id?

avatar image
tony.mudd wasin.w ♦♦ · Oct 31, 2019 at 10:58 AM 0
Share

I have now raised a Contact Premium Support case: RDC 08110361

Thanks, Tony.

2 Replies

  • Sort: 
avatar image
Best Answer
Answer by tony.mudd · Nov 25, 2019 at 09:54 AM

After some communication with Premium Support, a solution where I store my own managed RespStatus. Our solution with this has now been tested for a couple of weeks and appears to have fixed the issue.

Attached is the class I used for our managed clone of the RespStatus, which other developers are welcome to use (hopefully, it'll save you some time fixing the same problem).

ETXRespStatus.cs.txt

It contains the managed storage for the enums & string contained in the RespStatus, with a "copy constructor" to create itself from a RespStatus and a method to re-create the RespStatus.


etxrespstatuscs.txt (2.4 KiB)
Comment
Jirapongse

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Jirapongse · Oct 04, 2019 at 03:03 AM

One thing that I can think of is the object may be collected by the garbage collector.

It was mentioned in the Advanced .NET Debugging book that, in the release build, the JIT compiler can get rather aggressive and consider a local variable dead even before it goes out of scope (assuming it is not being used).

If this problem doesn't happen in the debug build, this could be the issue.

You can try to pin the object with the GCHandle.Alloc method.

 GCHandle h1 = GCHandle.Alloc(obj, GCHandleType.Pinned); 
 ...
 h1.Free()



Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

Does RFA.NET have methods that don't throw exceptions when a field definition is not found?

RFA InvalidUsageException when deocode filedlist

Disable Error message box in RFA

Getting End of Day price of stocks via RFA.NET

RFA .NET Level 2 data subscription

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges