Search   

Sunday, February 05, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  NDO and Oracle...
 NDO and Oracle
 
 5/17/2006 11:12:20 AM
anonymous
20 posts


NDO and Oracle
Hello Support Team, We are right now testing your NDO tool and have problems connecting to an Oracle database via the NDO configuration dialog/Preset for Application/database connection properties We always receive an error message during connection to the database. It seems, as if we can't connect to the database. Thanks in advance for an answer. Z.
 5/17/2006 11:14:01 AM
roblan
5 posts


Re: NDO and Oracle
It seems, as if you had a problem with the Oracle configuration. Is the tnsnames.ora correctly configured on client side? Can you reach the server with tnsping? I assume the message does not have do do with NDO, it comes from the DB-provider in Windows. Please contact me again if that does not help. Best Regards: Robert
 5/17/2006 11:15:45 AM
anonymous
20 posts


Re: NDO and Oracle - autogenerated Id's?
Hi Robert, thanks for the information. The problem was caused by the tnsnames.ora. The next error appears with a simple query: PersistenceManager pm = new PersistenceManager(); Query q = pm.NewQuery(typeof(NameOfMyClass), "nr < 30"); q.Execute(); > Exception: The provider of type NDO.NDOOracleProvider doesn't support Autonumbered Ids. Use Self generated Ids instead. What causes this error? And how can I remove it?
 5/17/2006 11:17:03 AM
Mirko
109 posts
5th


Re: NDO and Oracle - autogenerated Id's?
 Modified By admin  on 5/17/2006 12:47:02 PM)
NDO tries to use autonumberd integer IDs as Object Ids by default. But that doesn't work with Oracle. Oracle doesn't support autonumbered IDs. A good solution would be to use GUID ids. For that you have to add the NDOOidType attribute to your class:
[NDOPersistent, NDOOidType(typeof(Guid))]
class Test { ... }

To use Guids with all classes, use the assembly-wide attribute in assemblyinfo.cs:
[assembly: NDOOidType(typeof(Guid))]
You have also the option to use integer IDs created with the help of an Oracle sequence. To make that work, you have to create a callback function called each time by NDO if a new ID is needed. You then register this function as handler for the event IdGenerationEvent of the PersistenceManager and assign new IDs Inside it. Look at our sample program in the download section, which shows, how to create IDs using Oracle sequences. Note, that you need such a handler, even if you only read from the database in your sample program. I'd prefer Guids over sequences, if I didn't have to work with existing databases. Guids are faster and easier to use.
Best Regards, Mirko
  NDO-Forum postings in english please, if possible.  Developing with NDO  NDO and Oracle...
  SearchSearch  Forum HomeForum Home