Re: Single thread creation queue?

2021-11-22 Thread Jesse Tayler via Webobjects-dev
Oh? Thanks - I hadn’t heard of such a thing. This would be Amazon RDS which is basically MySQL and likely has similar. Either way I guess I should delete any dups, they either cause an error somewhere or at least integrity problems I don’t need. Is there a good wiki page on migration examples

Re: Single thread creation queue?

2021-11-22 Thread Aaron Rosenzweig via Webobjects-dev
Sounds like you are using Postgres? You can use the syntax “not valid” when you create a constraint to stop the bleeding immediately. It will then only check for new and modified records allowing the bad rows to co-exist. When you get around to it, you can remove the duplicates. If it’s

Re: Single thread creation queue?

2021-11-22 Thread Jesse Tayler via Webobjects-dev
It’s not a compound key so much as just policy — it’s a handle for social service and so there should just be one row with that value and don’t need to tie into the key I guess I can create a unique index just for that one attribute and it would presumedly return an error upon save. I should

Re: Single thread creation queue?

2021-11-22 Thread Samuel Pelletier via Webobjects-dev
Jesse, So your row have a primary key and some other unique identifier derived other attributes. If the compound key is a combinaison of full attribute values, you cana a compound unique key in the database. CREATE UNIQUE INDEX ON Table (col1, col2, ..., coln) If it is from partial values,

Re: Single thread creation queue?

2021-11-22 Thread Jesse Tayler via Webobjects-dev
It’s likely just a unique constraint perhaps. It’s not UIDs or primary keys it’s a unique row type based on a couple strings where there should be only one, and that one should last forever. There’s an API where calls can come in basically at the same time and instead of fetching first to see

Re: Single thread creation queue?

2021-11-22 Thread Samuel Pelletier via Webobjects-dev
Hi Jesse, Your question may have multiple answers, can you describe the contexts and duplicate sources you fear ? Is the primary key generated by the WO app or it is external (like a GUID) ? Do you have a secondary identifier that should be unique ? Anyway, you should add constraint in to the

Re: Single thread creation queue?

2021-11-22 Thread Aaron Rosenzweig via Webobjects-dev
Hi Jesse, What about SQL level “unique” and “check” constraints? > On Nov 22, 2021, at 8:34 AM, Jesse Tayler via Webobjects-dev > wrote: > > I asked on slack but I figured I’d ping the list > > Who has a good way to ensure a serial EO creation queue when the system could > be hit really

Single thread creation queue?

2021-11-22 Thread Jesse Tayler via Webobjects-dev
I asked on slack but I figured I’d ping the list Who has a good way to ensure a serial EO creation queue when the system could be hit really fast and you must avoid duplicate entries? I’m a bit surprised I don’t recall EOF style solutions for such things and maybe the Amazon RDS database has a