Author Topic: Weird very large numbers in t_objectconstraint.Weight column  (Read 559 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12349
  • Karma: +490/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Weird very large numbers in t_objectconstraint.Weight column
« on: January 18, 2023, 12:52:52 am »
When experimenting with project transfers, we stumbled upon an issue.
Some of the values stored in the t_objectconstraint.Weight column were too large for the target database.

No upon doing a query, I found that some of these values are indeed ridicilously large. (e.g. 4E+56 and 2E+50, and so on)
When looking in the GUI I don't even see a field that exposes this weight property, so I'm a bit puzzled as how these values got there in the first place.

Does anyone have a similar issue; and possibly a clue on what is going on here?

I can of course set them all to 0 with a simple update query, but I'm afraid they will come back if I don't know where they came from originally.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12349
  • Karma: +490/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #1 on: January 18, 2023, 01:07:32 am »
I found out the weight field is used to store the order of the constraints. If you move them up/down, the weight value gets changed.

I've experimented a bit, but I can't make it misbehave; but it might have been a bug in an earlier version that made those weird figures appear.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13147
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #2 on: January 18, 2023, 10:01:34 am »
Will the consitency check repair them?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12349
  • Karma: +490/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #3 on: January 18, 2023, 04:24:44 pm »
Will the consitency check repair them?

q.
No, I run those regularly, and they haven't touched the weight values.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13147
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #4 on: January 18, 2023, 08:35:52 pm »
Well, at least one additional info. The current statement about weight in my Inside is "does not seem to be mapped in the GUI".

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12349
  • Karma: +490/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #5 on: January 18, 2023, 08:39:06 pm »
Well, at least one additional info. The current statement about weight in my Inside is "does not seem to be mapped in the GUI".

q.
Yeah, you could change that into "is named wrong and should really be named pos to be consistent with t_attribute etc..."

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13147
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #6 on: January 18, 2023, 10:44:25 pm »
You can bet on that xD

q.

P.S. When you issue a query the Weight actually is shown as a Real number. The example model has a few with weight 1.00 but most being 0.00
« Last Edit: January 18, 2023, 10:52:28 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12349
  • Karma: +490/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #7 on: January 18, 2023, 11:39:14 pm »
You can bet on that xD

q.

P.S. When you issue a query the Weight actually is shown as a Real number. The example model has a few with weight 1.00 but most being 0.00
Ah, I can now think of a scenario where that might have gone wrong.

- Get the weight value as string "1.00"
- Try to store the same value as Real, messing up the decimal point/comma notation, and end up storing the value 100 instead.
- Get the weight value as string "100.00"
- Try to store the same value as Real, messing up the decimal point/comma notation, and end up storing the value 10000 instead.
- Rinse and repeat

And that indeed checks out with the actual values found. Most of them are round numbers like 5000000000 or 2000000

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13147
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Weird very large numbers in t_objectconstraint.Weight column
« Reply #8 on: January 19, 2023, 12:08:41 am »
Yep. I always imagine the DB design troupe of Sparx as a horde of chimps hacking on keyboards. But more likely is: there's just nobody and the trainee is responsible. Who knows. But you can see: it's sick.

I have just published the update...

q.