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

Error at deployment

3 Answers 69 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
LordRevan007
Top achievements
Rank 1
LordRevan007 asked on 22 Nov 2011, 01:18 PM
Hello there,
I am using Telerik open access orm with postgresql to create a desktop based application that will be run in LAN area. I shared app.config through all of my projects that are in my solution changed my connection string with other one and no problem appeared. But at deloyment when I ran a query against my db I get the following exception:

An item with the same key has already been added. mscorlib    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Telerik.OpenAccess.DBRegistry.GetDatabase(String urlOrConnectionId, Configuration& configuration)
   at Telerik.OpenAccess.Database.Get(String connectionString, BackendConfiguration backendConfiguration, MetadataContainer metadataContainer)
   at Telerik.OpenAccess.OpenAccessContextBase.GetDatabase()
   at Telerik.OpenAccess.OpenAccessContextBase.GetScope()
   at Telerik.OpenAccess.OpenAccessContextBase.ClearChanges()

Thanks in advance for any suggestion.

3 Answers, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 22 Nov 2011, 04:11 PM
Hi Lordrevan007,
Can it be that you catch the exception that was thrown by the same context and do this ClearChanges() in the exception block? It looks like you are hiding the real cause.

Nevertheless I have changed the code so that this error cannot occur in the future. 

Best wishes,
Jan Blessenohl
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

0
LordRevan007
Top achievements
Rank 1
answered on 23 Nov 2011, 07:58 AM
Thanks a lot for the solution, I just remove clearChanges and it worked like a charm. I hope there won't be any problem.

Thanks!
0
Marco Teodoro
Top achievements
Rank 1
answered on 23 Feb 2012, 03:53 PM
I have the same problem. What have you done?
Tags
Development (API, general questions)
Asked by
LordRevan007
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
LordRevan007
Top achievements
Rank 1
Marco Teodoro
Top achievements
Rank 1
Share this question
or