Code First EventSink Interface not supported

Im completely lost with this first CodeFirst Eventsink project. Could you please review the attached very simple project. I was testing my other problem "eventSink missing in Interface file with this.

According to your suggestion the event sink will be generated now in the interface file as expected. To use the interface outside the implementation i moved the interface into a separate unit. Maybe this is the problem.

The case now: every few time i compile the server or/and client or/and update the interface file the following happens: as soon the server calls the eventsink method to the client - the client will throw an exception: “interface not supported”.

Sometimes you have to recompile 10 times to get the problem. The you can recompile it 100 times to get the expected state. All this without changing anything at the source.

Im using Delphi 10.4 Patch 1-3 Remobjects 10.0.0.1481
What i’m doing wrong?

Note: I’ve had this problem once some time ago with a .Net Code First Server on my Delphi 10.4 Client Side.RoEventSinkCodeFirsttestcase.zip (14.8 KB)

Hi,

it seems to be a bad EMBT code optimization.
try to set Code inlining control to Off:


and rebuild client.

looks like, this fixes your case. at least I can’t reproduce your behavior after 10 rebuilds

Wow. How do you know about this? It really seems to “fix” the issue. But do you know about any side affects if i turn this option to off? And do i have to report this somehow? I wonder if i’m the only one who has this problem.
Thanks a lot so far.

Edit: Would it be possible to turn the feature off just in a certain part? But in which one?

Hi,

you might lose few percents of performance with disabled inlining.
from http://docwiki.embarcadero.com/RADStudio/Sydney/en/Calling_Procedures_and_Functions_(Delphi)#Using_the_inline_Directive :

you can test Auto value. it also might fix original issue

yes, it is a good idea, but main problem is create a simple testcase preferable w/o RO/DA that reproduces this issue

yes, you could. try to play with {$INLINE OFF} define as suggested in above article on EMBT site

Just for your information: i’ve just updated to Delphi 10.4.1. Turning on code inlining control on in options will not show the above problem anymore with this Delphi Version…