Starts in:
2 DAYS
16 HRS
29 MIN
46 SEC
Starts in:
2 D
16 H
29 M
46 S

Activities of "mgurer"

I also want to add this line; if I knew that polymorhism is blocked by Abp’s design choice, I would never, ever start using abp. I wish I knew at the beginning. I was actively advocating the framework to my network for their sake of good, now I understand that I mistakenly lead them to into a nightmare. Sorry for them. My bad.

Hi again. I don’t prefer to implement two seperate implementations and controllers. This really makes no sense. You take serious amount of power off from our hands with this limitation. What is left in the language if you exclude the inheritence and polimorphism. Too disappointed.

Thanks anyway

Hi. Thanks for your support. 👍

I tested code and it does its job as expected.

I have further questions about the topic;

1 - I am curious about the unexpected side effects of this workaround. Is there any?

2 - Should I suspect about other entities for this issue?

3 - Is this buggy behavior efcore-wise problem or is it specific to OpenIddictApplication entity?

Thanks

Sent

Is that postgres db that you select as dbms? I suspect about some wierd behaviour on timestamped columns.

I can provide a sample proj that I genererated recently.

Nope. I wont share any codes, logs with you. Check your frameworks codes? If you dont able to reproduce that behavior, we will consider what we can do then.

I dont get it. Are you serious?

I already saw the concurrency exception log and came here to ask what is going on? You want me add logs to the app.

The behaviour is not related to my very own codes. Even a new blank application behaves as I mentioned before. If you try it for yourself, you will see the record in the OpenIddictApplication table gets updated on each call to connect/token endpoint with client_credentials granttype.

Answer

Hi,

I think problem was due to a property on Message entity. The cli typed property was mapped to a db column containing json string. The json mapping convension somehow didnt worked in new version. Everytime context is saved, the context assumed that the property is altered so savechanges triggered once more which lead the loop in unitofwork.

I simplified the mapping convension of entity property to json column, the problem gone away. I wont dig into detail and have no clue what changed between abp versions.

Here is the mentioned simplified convension function which works fine.

public static PropertyBuilder<Message> HasMessageJsonConversion(this PropertyBuilder<Message> propertyBuilder) { var settings = GetSettings();

var converter = new ValueConverter&lt;Message, string&gt;
(
    v => JsonConvert.SerializeObject(v, settings),
    v => JsonConvert.DeserializeObject&lt;Message&gt;(v, settings)
);

var comparer = new ValueComparer&lt;Message&gt;
(
    (l, r) => l.Equals(r, settings),
    v => v == null ? 0 : JsonConvert.SerializeObject(v, settings).GetHashCode(),
    v => JsonConvert.DeserializeObject&lt;Message&gt;(JsonConvert.SerializeObject(v, settings), settings)
);

propertyBuilder.HasConversion(converter);
propertyBuilder.Metadata.SetValueConverter(converter);
propertyBuilder.Metadata.SetValueComparer(comparer);

return propertyBuilder;

}

Thanks Murat

Thanks

No related backlog item is listed about the update.

https://docs.abp.io/en/commercial/latest/road-map

Showing 1 to 10 of 50 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06