GUID support in Postgres

Posts   
1  /  2
 
    
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 28-Jun-2011 22:19:42   

I am using the model-first paradigm to design out a postgres DB for a variety of web services. I can connect to the postgres db with the designer fine, however when I create an entity with an identity column of type GUID it will not let me Automap the unmapped column, giving this error

Auto-map unmapped entity fields results Auto-map results Actions performed for entity 'Session' Database: PostgreSql (Npgsql) One or more unmapped fields were detected and at least one wasn't mappable automatically to a new target.

I know that npsql maps GUID types to UUID and it's supported with the version of the driver I am using

http://npgsql.projects.postgresql.org/docs/manual/UserManual.html

Driver Version: 2.0.11.91 LLBLGen Version: 3.1

I'm a bit of an LLBLGen noob, but I'm reading up as fast as I can, so it's very likely I'm missing something basic

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-Jun-2011 04:32:33   

Reproduce with the June 17th build. If you go from database the mapping works but if you go from model-first it's unable to do the mapping.

Even if you try to map it manually via the "New field" button, the uuid type isn't shown in the DBtype dropdownlist. So I think that is the problem.

We will look into this as soon as possible.

David Elizondo | LLBLGen Support Team
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 05:07:10   

Thanks for the quick reply! simple_smile Glad to see you guys are on top of it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-Jun-2011 10:03:48   

The driver contains a series of functions which determine .net -> db type. I think it misses the guid mapping. We'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-Jun-2011 10:17:33   

Please use the attached driver (it's a debug build, the final is released later this week).

Copy it as administrator in the folder: <llblgen pro installation folder>\Drivers\Postgresql

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 15:50:13   

I copied the new driver into the correct folder, however it wouldn't allow me to open the project because it referenced a driver that didn't exist. So I removed the part of the solution file that contained the driver references (this is more a proof of concept, so I don't mind losing work). It opened the project then without the Relational Model Data, and I tried connecting again however the npgsql driver wasn't on the list of Database Drivers anymore. I replaced the driver with the old one and everything worked again.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-Jun-2011 16:20:10   

Hmm... very strange. Will look into this.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-Jun-2011 16:24:34   

Made a release build. This should work OK.

Copy in llblgenpro installation folder\Drivers\Postgresql

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 16:27:26   

Still didn't work, I'm running llblgen in .net 4.0. Could that be causing the issue?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 29-Jun-2011 16:51:36   

64-bit or 32-bit?

Which LLBLGen Pro Designer are you running? There are 3 of them:

LLBLGenPro.exe LLBLGenPro_NET40.exe LLBLGenPro_x86.exe

joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 16:53:47   

LLBLGenPro_NET40.exe

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 29-Jun-2011 17:19:55   

64-bit or 32-bit?

joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 17:25:02   

I'm running 64 bit Windows 7, I can't seem to find any information in the program on what version it's running other then the executable I posted, however it's installed into the "Program Files (x86)" which leads me to believe LLBLGen is running in 32bit.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 29-Jun-2011 20:18:31   

Yes, but that shouldn't matter. The driver is from the official release build, so if you'd download it in the full installer, it would be the exact same dll.

That's the weird part. Did you copy the dll as administrator into the folder? This is important.

If you run fuslogvw.exe from the .net 4.0 SDK folder (in vs.net), you should be able to check why it couldn't load the dll (open the log for llblgenpro.exe)

(driver loads fine on winxp 32bit, running llblgen pro on .net 4 using the .net 4 runner). The .net 4 runner exe indeed runs as 32bit.

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 29-Jun-2011 20:31:52   

I am in the administrator group on this pc, and the owner of the file is the Administrators group.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Jun-2011 05:09:51   

Otis wrote:

If you run fuslogvw.exe from the .net 4.0 SDK folder (in vs.net), you should be able to check why it couldn't load the dll (open the log for llblgenpro.exe)

Did you try that?

David Elizondo | LLBLGen Support Team
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 30-Jun-2011 06:05:27   

here's the log dump from the WhereRefBind entry

LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v3.1\LLBLGenPro_NET40.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/PostgreSql/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.dll.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v3.1\Drivers\PostgreSql\SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27
LOG: Re-apply policy for where-ref bind.
LOG: Post-policy reference: SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27
LOG: GAC Lookup was unsuccessful.
LOG: Where-ref bind Codebase matches what is found in default context. Keep the result in default context.
LOG: The post-policy assembly reference requires probing again.
LOG: Switch from LoadFrom context to default context.
LOG: Using application configuration file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v3.1\LLBLGenPro_NET40.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/SqlServerUDTAssemblies/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/SqlServerUDTAssemblies/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Oracle/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Oracle/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SqlServer/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SqlServer/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Firebird/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Firebird/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/OracleODPNET/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/OracleODPNET/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Access/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/Access/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/DB2/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/DB2/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/OracleMSOracle/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/OracleMSOracle/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SybaseAse/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SybaseAse/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SybaseAsa/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/SybaseAsa/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/MySql/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/MySql/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Solutions Design/LLBLGen Pro v3.1/Drivers/PostgreSql/SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Solutions Design\LLBLGen Pro v3.1\Drivers\PostgreSql\SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.dll
LOG: Entering run-from-source setup phase.
LOG: Binding succeeds. Returns assembly from C:\Program Files (x86)\Solutions Design\LLBLGen Pro v3.1\Drivers\PostgreSql\SD.LLBLGen.Pro.DBDrivers.PostgreSqlDBDriver.dll.
LOG: Assembly is loaded in default load context.
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 30-Jun-2011 09:55:41   

The dll loads fine it seems, so it has to be npgsql. What's odd is that the older dll seems to work, but this one doesn't... Both have no reference whatsoever with npgsql. When you try to open a project and try to add a postgresql container, does the log show it tries to load npgsql? It has to.

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 30-Jun-2011 15:31:53   

The libraries that are imported in are exactly the same regardless of which PostgreSqlDriver.dll I use. Neither seem to register pulling in the npgsql dll but at the same time i don't see it pulling in SQL Server dll's or mySQL dll's either, other then the drivers in the LLBLGen folder.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 30-Jun-2011 17:31:06   

the driver is asked to create a factory. (the DbProviderFactory). If that fails, the driver is ignored. This might be the reason you don't see it show up. Other than that, I have no idea what happens, or why it doesn't show up...

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 30-Jun-2011 22:40:11   

I'm not sure how to check to see if it created a factory, is there a log for that? Does the new dll specify a specific version? I'm using the newest version of npgsql i could get my hands on, perhaps that is the issue?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 01-Jul-2011 08:10:06   

I never tried that but I think you can download a diagnostic version of npgsql and use a trace listener.

Anyway, Could you try with an older npgsql, just to test? (say 2.0.0, 2.0.4.0 or 2.0.6.0).

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 01-Jul-2011 10:02:29   

I'll push the new build within a few hours so you can install that, as it seems the full install does work for you.

However, please note: the npgsql version you've downloaded has to be defined in the llblgenpro.exe.config file as npgsql doesn't define a dbproviderfactory in .net's machine.config. See: http://www.llblgen.com/documentation/3.1/Designer/hh_goto.htm#Concepts/DatabaseDrivers.htm

and then the section 'postgresql'

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 01-Jul-2011 16:50:25   

I've uploaded a new build of the installer. If you could please use that installer to see whether that fixes your problem. Note: it will overwrite llblgenpro.exe.config, so you have to make re-adjustments to that file again to make it load ngpsql, the latest version you have downloaded (path / version correction).

Frans Bouma | Lead developer LLBLGen Pro
joenathan
User
Posts: 27
Joined: 28-Jun-2011
# Posted on: 01-Jul-2011 16:55:03   

OK, I will try that and keep you posted.

1  /  2