These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: NHibernate and Sybase
PostPosted: Fri Nov 02, 2007 1:18 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:31 am
Posts: 42
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
1.2.0GA
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="SpringNetTest" assembly="SpringNetTest">

<class name="Product" table="Product">

<!-- A 32 hex character is our surrogate key. It's automatically
generated by NHibernate with the UUID pattern. -->
<id name="Id">
<column name="ID" />
<generator class="native" />
</id>

<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="Name">
<column name="name"/>
</property>

<property name="Description">
<column name="description"/>
</property>

</class>

</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
Sybase 12.5.3
The generated SQL (show_sql=true):
cant get that far :(
Debug level Hibernate log excerpt:


Hello, i am trying to connect to Sybase 12.5.3 from a C# application
here's my app.config
Code:
<nhibernate>
      <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />

    <!-- Sybase --> 
     <add key="hibernate.dialect" value="NHibernate.Dialect.Sybase11Dialect, NHibernate.Dialect "/>
     <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SybaseClientDriver, NHibernate.Driver"/>
     <add key="hibernate.connection.connection_string"
          value="Server=COL4_DEV_ASE;Provider=Sybase.Data.AseClient;DataSource=cdr001dev;UserID=osc_liv;Password=vernal" />


i keep on getting this exception
Code:
stacktrace=   at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
   at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String
name)
   at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String
name)
   at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
   at NHibernate.Cfg.Configuration.AddClass(Type persistentClass)
   at SpringNetTest.ProductManager..ctor() in C:\dotnet\SpringNetTest\SpringNetT
est\ProductManager.cs:line 21
Exception in constructor.Could not compile the mapping document: SpringNetTest.P
roduct.hbm.xml


FYI, line 21 of ProductManager.cs contains this code
Code:
config.AddClass(typeof(SpringNetTest.Product));


and the table created in Sybase is this
Code:
CREATE TABLE dbo.Product
(
    ID          int          NULL,
    name        varchar(100) NULL,
    description varchar(200) NULL
)


before connecting to Sybase, i have tried a local MSAccess database (exactly same table name and columns) and it worked fine...

anyone could tell me what i m doing wrong?

thanks and regards
marco


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.