This is a migrated thread and some comments may be shown as answers.

Cannot add item with key to MetaItemIndex

3 Answers 57 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Greg
Top achievements
Rank 1
Greg asked on 28 Jun 2012, 08:22 AM
When I update the model from database (Oracle 11g) I get the following message:

An unexpected exception has occured. The exception message is:
'Cannot add item with key 'MetaStoredProcedureParameter'TOROL'.KIMENO' to MetaItemIndex.'.

I get this message regardless of what I selected to update in the dialog. The culprit seems to be a group of stored procedures with identical names and signatures but in different packages. This is actually a valid setup. When I temporarily remove theese from the model xml, everything works, when I reintroduce them, everything breaks.

It seems OA uses only the short procedure name to identify model artifacts whereas it should use the package-qualified name. The same problem can be observed in the update from database UI and the model schema explorer where I can only see the short procedure name, not the containing package so I'm left with dozens of identical named entries.

The problem is only present when the procs are already part of the model when updating, not when I initially add them, but it's highly contraproductive to always remove then add them on every model update or sort out which is the one from the identical entries that I actually need. Otherwise I can map them to domain methods and use them normally, so this is mostly a designer issue.

3 Answers, 1 is accepted

Sort by
0
Ralph Waldenmaier
Telerik team
answered on 28 Jun 2012, 01:13 PM
Hi Greg,

I am afraid that you experience this behavior. I can see that we are not providing the package name into the Update Model from Database Wizard and in the Schema Model Explorer as well. I have added this to our backlog in order to provide a better story.
Regarding the exception you are reporting. I was not able to reproduce this. I added 2 packages to my test database with exactly the same procedures inside the packages. After that I reversed the database and was able to create the model. Even the Update Model from Database Wizard did not show an exception. Therefore I would like to ask you for more details on how I can reproduce this behavior. Which steps did you do exactly. How does your db schema look like?

Please accept my apologies for the inconvenience caused.

I am looking forward to hearing from you soon and solving this with you.

Greetings,
Ralph
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
0
Greg
Top achievements
Rank 1
answered on 28 Jun 2012, 02:17 PM
Hi,

The signature of the procedures are as follows:
Procedure torol (p_mod_UGYFEL_azon Varchar2,kimeno Out Varchar2 );

Most of my packages (including theese) follow the naming convention of <something>_CS (with further possible underscores in <something>)

I create a new rlinq model with the default settings, add the top two TOROL procs from the list (as it turns out they're from MODOSITO_LAP_CS and BEJKOT_TEVEKENYSEG_CS), then save the model. Then I right click (while the designer is still open), update from database, select a random table, leave everything on default, next, next... finish, error message. This reliably produces the exception for me. Maybe it has to do something with the out parameter?

Thanks in advance,
Greg
0
Ralph Waldenmaier
Telerik team
answered on 28 Jun 2012, 02:52 PM
Hello Greg,

Thank you for your description. Now I am able to see the exception you mentioned. We are not considering the package name during our calculation for the designer and that is why you see the exception. This is only the case, when parameters are involved in the procedures.
As I said, I have added this to our backlog and it will be addressed. To work around this problem in the meantime, as you mentioned, you can remove the stored procedures temporarily from the mapping, add your tables and then add the stored procedures again.

Again, please accept my apologies for any inconvenience caused.
Feel free to ask if you have any other question. 

Regards,
Ralph
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Design Time (Visual Designer & Tools)
Asked by
Greg
Top achievements
Rank 1
Answers by
Ralph Waldenmaier
Telerik team
Greg
Top achievements
Rank 1
Share this question
or