AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Not generate output #693

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Choose PostgreSQL server
2. Generate Data Project
3. Open project with MSVS2012
4. Generate Output

What is the expected output? What do you see instead?

\Entities.csp(0,0) There is already an open DataReader associated with this 
Command which must be closed first.
Stack Trace:
   at Npgsql.NpgsqlCommand.CheckConnectionState()
   at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb)
   at Npgsql.NpgsqlCommand.ExecuteReader()
   at SchemaExplorer.PostgreSQLSchemaProvider.GetTablePrimaryKey(String connectionString, TableSchema table)
   at SchemaExplorer.TableSchema.#gHe()
   at SchemaExplorer.TableSchema.get_HasPrimaryKey()
   at CodeSmith.SchemaHelper.SchemaExplorerEntityProvider.LoadTables(TableSchemaCollection tables)
   at CodeSmith.SchemaHelper.SchemaExplorerEntityProvider.Initialize(TableSchemaCollection tables, ViewSchemaCollection views, CommandSchemaCollection commands)
   at CodeSmith.SchemaHelper.SchemaExplorerEntityProvider.Load()
   at CodeSmith.SchemaHelper.EntityManager..ctor(IEntityProvider provider)
   at _CodeSmith.Hbms_cst.CreateEntityManager()
   at _CodeSmith.Hbms_cst.Generate()
   at _CodeSmith.Hbms_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject project)

What version of the product are you using?

Code Generator 6.5.3 14838
PLINQ NHibernet 1.2

Please provide any additional information below.

Original issue reported on code.google.com by cahqs...@gmail.com on 19 Sep 2013 at 4:47

GoogleCodeExporter commented 9 years ago
Hello,

You need to change your connection string to use Preload Reader = true as 
detailed here: 
http://docs.codesmithtools.com/display/Generator/Configuring+and+troubleshooting
+a+Schema+Provider

"If you're using the PostgreSchemaProvider, please make sure the following 
statement is included in your ConnectionString: Preload Reader = true;"

Original comment by bniemyjski on 19 Sep 2013 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 19 Sep 2013 at 4:52

GoogleCodeExporter commented 9 years ago
new error message...

Entities.csp(0,0) Specified argument was out of the range of valid values.
Stack Trace:
   at SchemaExplorer.PostgreSQLSchemaProvider.GetNativeDbType(String type)
   at SchemaExplorer.PostgreSQLSchemaProvider.GetCommandParameters(String connectionString, CommandSchema commandSchema)
   at SchemaExplorer.CommandSchema.#vxe()
   at SchemaExplorer.CommandSchema.get_ReturnValueParameter()
   at SchemaExplorer.CommandSchema.#Hxe()
   at CodeSmith.SchemaHelper.CommandEntity.Initialize()
   at CodeSmith.SchemaHelper.SchemaExplorerEntityProvider.Initialize(TableSchemaCollection tables, ViewSchemaCollection views, CommandSchemaCollection commands)
   at CodeSmith.SchemaHelper.SchemaExplorerEntityProvider.Load()
   at CodeSmith.SchemaHelper.EntityManager..ctor(IEntityProvider provider)
   at _CodeSmith.Hbms_cst.CreateEntityManager()
   at _CodeSmith.Hbms_cst.Generate()
   at _CodeSmith.Hbms_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject project)

Original comment by cahqs...@gmail.com on 19 Sep 2013 at 5:06

GoogleCodeExporter commented 9 years ago
Hello,

This looks like a bug with the schema provider. I'd recommend contacting 
support with a postgre sample database that can recreate this issue 
(support@codesmithtools.com) and we will take a look into this issue. You can 
also debug the provider yourself by following these directions 
(http://docs.codesmithtools.com/display/Generator/Debugging+a+Custom+Schema+Prov
ider). You would want to set a breakpoint on the 
PostgreSQLSchemaProvider.GetNativeDbType method.

Original comment by bniemyjski on 19 Sep 2013 at 6:07