Tech-IS Home   Forum Home   Search   Login   Register  
OxyGen Code  > Bugs, Fixes & Feature Requests  > An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
NiceOne is not online. Last active: 3/23/2014 10:21:28 PM NiceOne
Top 25 Poster
Joined: 14 Oct 2013
Total Posts: 4
 
An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 14 Oct 2013 09:25 PM
An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation. Exception has been thrown by the target of an invocation. Exception of type 'System.OutOfMemoryException' was thrown. at qq.Invoke(ConfigurationSettings A_0)
at System.String.ToCharArray()
at OxyData.Modelling.Generators.BaseClassCreator.RemoveSpaceBtwnNewlines(StringBuilder content)
at OxyData.Modelling.Generators.BaseClassCreator.AdjustNewlines(StringBuilder content, Int32 targetNewlineCount, Int32 desiredNewlineCount)
at OxyData.Modelling.Generators.DataProviderClassGenerator.Execute()
at OxyData.Modelling.Generators.RuntimeStatements.GetPersistanceAttributes()
at OxyData.Modelling.OutputManagement.OutputManager.GenerateFiles(FileTransformationReaderWriter frw, IPersistanceAttributesProvider`1 generator, String fileExtension, String metadataOutputFileName, String& lastContainer)
at OxyData.Modelling.OutputManagement.OutputManager.GenerateFiles(FileTransformationReaderWriter frw, IPersistanceAttributesProvider`1 classGenerator, String fileExtension, String metadataOutputFileName)


This occurs after an upgrade from 3.5 to 3.7. I have installed a fresh copy on both a Win 7 and Win 8 machine as well as attempting an inplace upgrade on both. I have run on Both a Virtual desktop with 12 GB of ram and a physical desktop with 4 GB of ram. If I de-select roughly have the objects to be generated (being a mixture of Stored Procs, virtual views and tables) the code generates fine. If there a limit on the number of objects, memory leek. I have monitored the resource monitor in the task manager and available memory never fell below 30%.

Would appreciate any assistance
Arinze is not online. Last active: 6/6/2014 1:59:48 PM Arinze
Top 25 Poster
Forum Moderator
Joined: 02 Feb 2008
Total Posts: 165
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 04 Nov 2013 11:02 AM
Hi,

Are you running a registered copy Oxygen Code 3.7 Advanced?

There's a limit in the discontinued 'Professional' edition.

How many objects are you trying to generated against?

OxyGen Code Generator, the Architected RAD Tool for .NET
NiceOne is not online. Last active: 3/23/2014 10:21:28 PM NiceOne
Top 25 Poster
Joined: 14 Oct 2013
Total Posts: 4
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 07 Nov 2013 03:08 PM
Have downloaded the trial 3.7 version from the website and have entered my key for version 3.5.1 Do I require a new key?

There are roughly 600 objects including tables and stored procs.
Arinze is not online. Last active: 6/6/2014 1:59:48 PM Arinze
Top 25 Poster
Forum Moderator
Joined: 02 Feb 2008
Total Posts: 165
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 13 Nov 2013 02:07 PM
If your key for 3.5 was accepted, then you don't need a new key.

Can you send us the execution log?
Go to:
Tools> Execution log...

Copy the details of the exception and post to the forum or email to:

oxygen.support@techinceptions.com

Thanks

OxyGen Code Generator, the Architected RAD Tool for .NET
Arinze is not online. Last active: 6/6/2014 1:59:48 PM Arinze
Top 25 Poster
Forum Moderator
Joined: 02 Feb 2008
Total Posts: 165
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 13 Nov 2013 02:13 PM
Having taking a second read of your post,

I believe you have to group your objects.

Having 600 objects in one schema or group will create a memory spike during the generation of the DataProvider class or the generation of the BusinessService class.

There are two ways to group your objects
1) Group your objects by using Schemas in the database
2) Group your objects by using the Virtual Schema feature in OCG Database Explorer

When your objects are group, each group will have it's own:
a) DataProvider
b) BusinessService
c) Namespace

OxyGen Code Generator, the Architected RAD Tool for .NET
NiceOne is not online. Last active: 3/23/2014 10:21:28 PM NiceOne
Top 25 Poster
Joined: 14 Oct 2013
Total Posts: 4
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 27 Nov 2013 03:44 PM
Thanks Arinze.

I have split the objects up into chunks of 100 using the virtual schema feature in the OCG database explorer and the error still occurs. I can happily generate code using version 3.5.12.0 with only one schema so unless there has been a change in the code generation engine in the latest version I cannot see why this would be an issue. I have also created a virtual PC and have assigned it 8 CPU cores and 22 GB of memory and observing the task manager I can see the spike but it fails to get anywhere near the full memory allocation.

Any other ideas?

Arinze is not online. Last active: 6/6/2014 1:59:48 PM Arinze
Top 25 Poster
Forum Moderator
Joined: 02 Feb 2008
Total Posts: 165
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 08 Jan 2014 11:52 AM
Hi,

The line below seems to be the culprit:

char[] testArray = content.ToString().ToCharArray();

I am not clear as to why it would create an "out of memory" exception, but I know one thing:

It is absolutely unnecessary.

It is one of two lines of testing code that was never removed.
We will remove the two lines of testing code.

I believe that is your case, the issue is that "content", which is a StringBuilder object, has a massive memory footprint. then it is converted to a string, which will have an equally large memory footprint, then it is converted to large array.

So "content", it's string equivalent, and the resulting char array will be present, all at the same time - hence the "out of memory" exception.

There may be a web or WCF related file or a metadata file, that contains information for the entire 600 tables. This may be the file that was being processed at the time of the crash.

OxyGen Code Generator, the Architected RAD Tool for .NET
NiceOne is not online. Last active: 3/23/2014 10:21:28 PM NiceOne
Top 25 Poster
Joined: 14 Oct 2013
Total Posts: 4
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 23 Mar 2014 10:21 PM
Thanks Arinze,

Do you know when the new compile will be available with the two lines of code removed?

The current download is still 3.7.0 dated 2012.

Cheers
Arinze is not online. Last active: 6/6/2014 1:59:48 PM Arinze
Top 25 Poster
Forum Moderator
Joined: 02 Feb 2008
Total Posts: 165
 
Re: An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.
Posted: 08 May 2014 02:07 PM
Before the 15th of May 2014

OxyGen Code Generator, the Architected RAD Tool for .NET
Previous Thread :: Next Thread 
Page 1 of 1
 
Tech-IS Forums  > OxyGen Code  > Bugs, Fixes & Feature Requests  > An error has been encountered while generating the source code. Exception has been thrown by the target of an invocation.