Print Page | Close Window

Missing RdbKey on the Client-side ibconfig file

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=184
Printed Date: 12-Jun-2026 at 10:01am


Topic: Missing RdbKey on the Client-side ibconfig file
Posted By: Customer
Subject: Missing RdbKey on the Client-side ibconfig file
Date Posted: 12-Jul-2007 at 2:42pm
I had a look at this section of the docs, I am using the 'sa' login to eliminate user permission issues.
 
I put the "AddtoManager statement in a try/catch block for the purpose of getting the details of the exception
 
I also added the details of my newly created object as it is, just before the failing statement. I used the Immediate Window in VS (?aQ_Base)
 
Please have a look at the details of the exception
 
"System.NullReferenceException: Object reference not set to an instance of an object.

at IdeaBlade.Persistence.PersistenceManager.CheckForPkIdentityColumn(Entity pEntity)

at IdeaBlade.Persistence.Entity.AddToManager()

at Model.Q_Base.Create(PersistenceManager pPM) in D:\Clients\DPS\Windows Application\DPS_CAB\Model\Q_Base.vb:line 66"

Later, I was also unsuccessful using the standard bigint and NextId nechanism:

For the purpose of isolating the problem,I just changed the Identity columns to normal bigint and implemented the NextID mechanism

again it works great as client server but this time, when deployed on IIS, it generates a "Object reference not set to an instance of an object..." exception at the
'pManager.GenerateId(aQ_Base, Q_Base.IDxEntityColumn)' statement
 
Again I use sa login and run IIS on Administrator account to eliminate permission problems.
 
please let me know if there is any other information you need to resolve this



Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 2:43pm
This reminds me of a case that I had over a year ago.  The customer was using Remoting and Identity columns.  The problem turned to be that the customer had no RdbKey on the Client-side ibconfig file.  Not only must there be a client-side ibconfig file, but you must also specify the Provider on the client ibconfig file so that the client-side PersistenceManager knows that the database could be using Identity columns.
 
I made the same mistake myself earlier when I first learned about Remoting.  I thought that because the Connection String only needed to be specified on the Server-side ibconfig file that there didn't need to be an RdbKey on the client-side ibconfig file.
 
Don't know if this is relevant or not, but I couldn't help from telling you about what your case reminded me


Posted By: Customer
Date Posted: 12-Jul-2007 at 2:44pm
The docs clearly state that one should not have any RDBKeys on the client side ibconfig. maybe you can send me an example of such config file.
maybe I am missing something trivial


Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 2:45pm
The example is the IIS Deployment Tutorial.
 
The docs say (or should be saying) that you should not put the Connection string on the  client side ibconfig file.  At the very least, you need an Ibconfig file that at least includes the name (e.g., "Default").  In the case of Identity Columns, you must also include the Provider name (so that the client PersistenceManager understands that there may be Identity Columns.


Posted By: Customer
Date Posted: 12-Jul-2007 at 2:45pm
I finally got it. I adjusted the ibconfig accordingly, and its working well for both (Identity and IIdgenerator).
 
By the way, The tutorial's ibconfig file includes a full connection string rather then what you suggest. I had a look at the Cabana and Funhouse and there I could find a few examples that demonstrate as you suggested. maybe  this is something that should be included in future tutorial?


Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 2:46pm
Congratulations!  I'm glad that you finally got it working.
 
I agree with your comment that the tutorial is not showing best practices.  I'll file a bug against this, and have it fixed.



Print Page | Close Window