Book a Demo

Author Topic: Populating EAP files with DB data  (Read 7381 times)

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Populating EAP files with DB data
« on: December 31, 2008, 05:57:33 pm »
I need to populate automatically EAP files with a repository in DB.\
I can not give the connections strings to the users that will populate the files, I also wouldn't want them to mess with connecting to DB.
We also have a problem that we use a different DB creation SQL so we can replicate the DB.
We tried copying rows from DB to the EAP, but it seems the constrains\relations\keys are sometimes different (am I wrong?).
Also we tried to populate t_object but failed because of the relationships.
I could try moving entity by entity through EA API, but I fear we might forget to move part of the data (reference date, connectors ends and such). Also it will be very slow.

Is there any way you can advice us to solve this problem? Do you maybe have a list of things we need to move if we do it through API to avoid forgetting something?
Thanks
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Populating EAP files with DB data
« Reply #1 on: January 01, 2009, 01:14:39 am »
Also: how problematic will it be to just delete the relationships.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Populating EAP files with DB data
« Reply #2 on: January 02, 2009, 04:30:45 am »
I'm not sure whether I understand your request.  Are you saying that you want to populate a repository which is something other than a Jet database using code?  The general recommendation is to use the API since that has built-in checks and balances, but it is perfectly possible to write directly to the database if you do enough poking around.  If you can read ABL (unlikely, I know), there is code here http://www.oehive.org/node/900 which does just that, covering a number of areas related to the data model, component model, and user interface model.  It doesn't cover an object or domain model because the code being modeled is mostly not OO.

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Populating EAP files with DB data
« Reply #3 on: January 02, 2009, 08:04:12 am »
It OK, we managed to do it.  I didn't want to work through
API because  it is critical for as to keep the same GUIDs.
We managed to copy it now though.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Populating EAP files with DB data
« Reply #4 on: January 02, 2009, 08:34:57 am »
If you are just moving from one repository (some DB) to an EAP repository, wouldn't you just use the Project Transfer functionality?

Or, if a partial move, then XMI export and import, preserving GUID?

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Populating EAP files with DB data
« Reply #5 on: January 02, 2009, 07:56:57 pm »
We are moving a huge DB, so XMI will be a PITA. We can't transfer since we had added some PKs for replication and it creates error.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Populating EAP files with DB data
« Reply #6 on: January 03, 2009, 05:15:32 am »
Ah, understood ... at least in that XMI can get big and problems in the model can block transfers.  But, if there is a problem in the model blocking transfers, shouldn't one be figuring out how to change it so that it is transferrable?  I ran into this with one of the models I had built and discovered that what I was doing wasn't really the best UML, so the answer is to change what I am generating.

Which said, I do wish Sparx would make the transfer more robust and informative.
« Last Edit: January 03, 2009, 05:16:22 am by tamhas »

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Populating EAP files with DB data
« Reply #7 on: January 03, 2009, 05:20:36 am »
No, the model really is huge - our products are developed by hundreds of developers and customized by even more - no way to do it smaller...
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Populating EAP files with DB data
« Reply #8 on: January 03, 2009, 05:40:57 am »
Well, I have one model that is about 30MB .... but it wasn't size I was commenting on.  While transfer is a bit too sensitive for my tastes and isn't very helpful about telling one what is wrong or trying to work around it, it seems like a model in good shape should transfer.  If you have done something to the model which transfer doesn't like, isn't it worth considering that one might do something else that accomplishes the purpose in a way that will allow transfer to still work?  E.g., I found an issue in my model where I had used a connector with a package which was not a supported UML combination.  This provided issues even with an XMI dump and load.  The answer for me is to move to using a component instead of a package since it is more correct UML, even though a package seemed to intuitive fit the purpose.  I'm just wondering if the reason transfer isn't working for you is something similar where an alternative approach might exist.

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Populating EAP files with DB data
« Reply #9 on: January 03, 2009, 06:20:43 am »
No, my model it just about 400MB. but this is a good remark you made now - if it si not UML compliant it won't be exported...interesting...
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Populating EAP files with DB data
« Reply #10 on: January 03, 2009, 06:53:06 am »
In my case, doing an XMI transfer on a small model produced by the same approach, the model exported to XMI just fine, but it was the load that failed.  I used the XMI because a transfer was failing and I now understand the issue with the XMI.  I don't yet know if the problem with the transfer is the same.

The other issue with transfer I have seen is data type incompatabilities, e.g., Text at 225 characters and Memo at 64K characters in Jet versus Character at 32K characters in OpenEdge with no EA support for CLOBs in the OE database.  For t_umlpattern, this sets up a situation for a number of records where there are columns containing more than 32K characters which won't go into the OE database and then coming back in the reverse direction it is unhappy because of the resulting NULLs.  There is no way to get 64K of data in a 32K spot, but one can at least make the whole thing more polite once one understands the problem.