Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 04 20:36
    vzakanj opened #2482
  • Feb 04 20:36
    vzakanj opened #2482
  • Feb 04 20:14
    dgrozenok opened #2481
  • Feb 04 20:14
    dgrozenok opened #2481
  • Feb 04 11:25
    oskardudycz synchronize #2467
  • Feb 04 11:25
    oskardudycz synchronize #2467
  • Feb 04 11:25

    oskardudycz on bug-fixes

    corrected expectation on genera… Made the Update.ApplyCallbacks/… Moving the database generator c… and 3 more (compare)

  • Feb 04 11:25

    oskardudycz on bug-fixes

    corrected expectation on genera… Made the Update.ApplyCallbacks/… Moving the database generator c… and 3 more (compare)

  • Feb 04 11:24

    oskardudycz on master

    Bumped Weasel version to enable… (compare)

  • Feb 04 11:24

    oskardudycz on master

    Bumped Weasel version to enable… (compare)

  • Feb 04 11:24

    oskardudycz on advisory_locks_improvements

    (compare)

  • Feb 04 11:24

    oskardudycz on advisory_locks_improvements

    (compare)

  • Feb 04 11:24
    oskardudycz closed #2479
  • Feb 04 11:24
    oskardudycz closed #2479
  • Feb 04 11:24
    oskardudycz commented #2479
  • Feb 04 11:24
    oskardudycz commented #2479
  • Feb 04 11:23
    oskardudycz opened #2480
  • Feb 04 11:23
    oskardudycz opened #2480
  • Feb 04 11:13
    oskardudycz edited #2479
  • Feb 04 11:13
    oskardudycz edited #2479
Phillip Haydon
@phillip-haydon
thanks for the recordings @oskardudycz, plan to watch tomorrow, my daughter was born yesterday so in hospital with wife with a bit of free time
Oskar Dudycz
@oskardudycz
Congratulations Phillip! I hope that's all fine :)
Jeremy D. Miller
@jeremydmiller
Oh wow, congrats Phillip! Hope everybody is doing well
Babu Annamalai
@mysticmind
Congrats @phillip-haydon!
Jeremy D. Miller
@jeremydmiller
@oskardudycz @mysticmind I'm piddling around w/ minor document updates today and maybe this weekend. The newish FetchForWriting() functionality? Would you all rather have that added to the existing appending web page, or an all new page?
I'm leaning toward an all new page that's dedicated to handling CQRS commands, but I'd be very happy to have any suggestions for what that page would even be called
Phillip Haydon
@phillip-haydon
Thanks. Mum and baby are doing really well.
Oskar Dudycz
@oskardudycz
Great Phillip, keeping fingers crossed 🤞 once again congrats!
@jeremydmiller, I’d also vote for a dedicated page. I’m not sure if it has to be named CQRS. To not make some people defensive, maybe “Handling Business Logic” would be better and then inside mention CQRS.
Babu Annamalai
@mysticmind
@jeremydmiller if we have it in a separate page, discovery is going to be a problem since it is not cohesively in one place. I would suggest to add to to appending itself. Thoughts?
Just re-looking, alternative is to put it in https://martendb.io/scenarios/aggregates-events-repositories.html where we are talking about different scenarios. So this could be in a scenario based explanation.
in addition, put it under appending as well for each method. Also a a link to a section in the above mentioned page with a short explanation.
Probably, the above is better...
Phillip Haydon
@phillip-haydon
repositories bad!
Babu Annamalai
@mysticmind
I meant to add a scenarios page for using FetchForWriting()
Babu Annamalai
@mysticmind
@jeremydmiller PR's JasperFx/marten#2322 (merged recently) and JasperFx/marten#2310 look to be related. Possibly, we can close #2310 as well?
Simon Lovely
@slovely
Hi all, I've watched the great videos last week by Jeremy and Oskar, and had a quick play with the event sourcing stuff. I'm missing something fundamental in how projections work though, and wonder if anyone would be able to spare 10 mins to tell me what I'm doing wrong. I think everything needed to repro is here: https://gist.github.com/slovely/ee50e8ffb318d604473ed66c585d17b5
Basically, I've created a couple of events and have a SelfAggregating projection, but only the most recent event seems to be reflected in the projection. See the comment on the gist for the full repro steps. My understanding could be wrong, but I thought that the projection would contain the latest state of all the events.
Thanks very much,
Simon
Jeremy D. Miller
@jeremydmiller
@mysticmind Yeah, I didn’t notice that the PR came in with the fix before I dealt with that. The fix I did is more generic and should go forward. I thought we could take in his test code as another regression at least. I just didn’t get around to doing the merging yet
1 reply
Oskar Dudycz
@oskardudycz
Hey Simon, I apologise for the delay in answering you on Twitter; I’ll try to do that later today.
Jeremy D. Miller
@jeremydmiller
@slovely You’re wiping the data in the database between tests is the first thing: https://gist.github.com/slovely/ee50e8ffb318d604473ed66c585d17b5#file-marteneventstoretests-cs-L33
Simon Lovely
@slovely
No worries Oskar - it's free help, you are under no obligation :)
@jeremydmiller I'm not re-running that test though, just running specific ones.
But I could definitely be doing something wrong!
Jeremy D. Miller
@jeremydmiller
@slovely Can you be a little more specific about what is not working? A failing test would be best. You’re not doing anything that isn’t straight forward
Simon Lovely
@slovely
Sure, let me try and amalgamate that all into a single test. It's definitely going to be me doing something wrong :)
Simon Lovely
@slovely
@jeremydmiller @oskardudycz OK doing that has lead me to discovering the issue! (should have explained it to a rubber duck first!). The problem is resolved if I change the properties on the projection to not have a private setter. I shouldn't have assumed that Marten would use reflection!
Oskar Dudycz
@oskardudycz
Thanks for follow up 👍 Check also https://martendb.io/configuration/json.html
You can set the private members handling options also to allow private ones.
The important thing is I have a field named Id with getter and setter
Simon Lovely
@slovely
Thanks - using _.UseDefaultSerialization(nonPublicMembersStorage: NonPublicMembersStorage.NonPublicSetters); also fixes it (as did init properties too). All makes perfect sense, knew it would be something straightforward!
Appreciate the help guys!
Oskar Dudycz
@oskardudycz
Happy to help 👍
Michał Gajek
@migajek
Hello :) I have a question regarding projections. Is there any guarantee on the order of projections processing (especially when rebuilding)?
Since built-in projections can take IQuerySession for doing additional lookups, I wonder if it is feasible to query against documents generated by other projections? But for that, we'd need to have some guarantees on the order of processing.
Alternatives I can think of, are keeping "helper" documents or doing live aggregations for lookups
Oskar Dudycz
@oskardudycz
Nope, there's no guarantee about ordering between projections.
Typically, it's best to avoid having dependencies between projections for that reasons.
Jeremy D. Miller
@jeremydmiller
@migajek What Oskar said, but I'm somewhat in favor of possibly changing that in the long term. That being said though, I do think you could use the build products of an inline projection in an async projection -- but it'd be on you in the rebuild to make sure the inline projections are executed before the async projections if needed.
When I did the last big overhaul of the projections command I almost changed it to rebuild inline projections first before starting the async, but punted on that
Ben Edwards
@elexisvenator
I have a dedicate container task that is triggered on deployment that manages the rebuilding or projections, using our own state table to detect what has changed since last deployment (new models, old ones removed etc). The main reason this was needed was to ensure inline projections are backfilled.
Michał Gajek
@migajek
Thanks for all the answers!
quite some time ago when I previously used Marten extensively (probably around 4 years now, wow!) I made a PR that made it to the Marten allowing the projection to manage multiple document types; thus - allowing building "helper" models, so that the projection was not dependent on the others. It looks the code is long gone after the overhauls (BTW must admit the projections stuff makes much better impression nowadays :) ) but the idea seems to have stayed there - there's the Published Type concept in the ProjectionBase. Will try to implement something around that :)
Chris Maffin
@Sacrelicious
Hi Marten folks, I apologize if this question has already been asked and answered either here or in the documentation, but I couldn't find it: what's the correct way to make sure my session is disposed when returning .ToAsyncEnumerable()? My code is as follows, and it appears that the session is not always (ever?) disposed properly, leaving the connection to postgres open and occasionally resulting in connection pool exhaustion on the server end.
public IAsyncEnumerable<UserAggregate> GetUsers(CancellationToken cancellationToken)
        {
            using var session = _store.LightweightSession();

            return session.Query<UserAggregate>().Where(x => x.IsActive).ToAsyncEnumerable(cancellationToken);
        }
Jeremy D. Miller
@jeremydmiller
Yeah, don't do it that way:)
You need to consume the async enumerable and dispose it before you can dispose the session and its underlying database connection. Keep in mind that the point behind using the async enumerable is that you can be consuming the data even while Marten is still busy fetching data and connected to the database
Chris Maffin
@Sacrelicious
is there any way to use the asyncenumberable at the service level? (say i want to call a different repo for each item in the collection)
Jeremy D. Miller
@jeremydmiller
Oh man, are you just really wanting to set me off on a rant about entity specific respository abstractions?
Chris Maffin
@Sacrelicious
heh, well, i'm actually calling an external API for each item if that makes it better
Jeremy D. Miller
@jeremydmiller
I think you're going to need something from outside your repository that manages the repository's and therefore your session's lifecycle. That'd work around that.
Or use some kind of callback that you pass into your repository where it "pushes" out the results so it can manage its own lifecycle
Chris Maffin
@Sacrelicious
gotcha, that makes sense and is kinda what i figured, just making sure I wasn't missing something obvious. thanks!
Oskar Dudycz
@oskardudycz
image.png
@/all folks, I'm working on the event versioning docs (both IntelliSense and web page). Do you think that putting such thorough explanation in IntelliSense is helpful or is it just nice-to-have?