NH1.2.0 ?!!?!!??Really ?

2009/4/27 Anthony Dyer <[email protected]>

>
> Anyone has any ideas of how to get around this problem?
>
> Anthony Dyer
> Director of Technology, Transportation
> (847) 954 4526 or (847) 699-6620
> [email protected]
> www.logility.com
>
>
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Anthony Dyer
> Sent: Monday, April 27, 2009 12:46 PM
> To: [email protected]
> Subject: [nhusers] Re: Oracke Transaction
>
>
> Thanks for the reply-
>
> The mapping is:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
>        <class name="Logility.WebDB.Table.user_def, WebDB.Entity"
> table="user_def" lazy="true">
>                <id name="user_nbr" column ="user_nbr"
> type="Logility.Data.Type.NumericInteger, Logility.Data">
>                        <generator class="assigned" />
>                </id>
>                <property name="name_txt" column="name_txt" type="String"
> length="60" />
>                <property name="pass_txt" column="pass_txt" type="String"
> length="128" />
>                <property name="email_txt" column="email_txt" type="String"
> length="500" />
>                <property name="user_id" column="user_id" type="String"
> length="60" />
>                <property name="style_txt" column="style_txt" type="String"
> length="100" />
>                <property name="ldap_ind" column="ldap_ind"
> type="Logility.Data.Type.Fixed1, Logility.Data" length="1" />
>                <property name="sys_user_id" column="sys_user_id"
> type="String" length="30" />
>        </class>
> </hibernate-mapping>
>
>
> I have attached the code for the logility.data.type.integer and
> logility.data.type.fixed1
>
> I am not sure why we have done it this way- but it is what I have to work
> with-
>
> The fields are defined the same in SQL Server and Oracle-
>
> I have attached how the first field (key) is defineed in both SQL and
> Oracle-
>
> I did notice that all of the lenghts in the mapping are greater than
> (usually double) the lengths on the columns themselves- but do not think
> that should cause a problem-
>
> Especially since this is a SELECT (read)
>
>
>
> Anthony Dyer
> Director of Technology, Transportation
> (847) 954 4526 or (847) 699-6620
> [email protected]
> www.logility.com
>
>
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of mhanney
> Sent: Monday, April 27, 2009 11:48 AM
> To: nhusers
> Subject: [nhusers] Re: Oracke Transaction
>
>
>
> In hibernate.session.jpg IdentityColumnString throws an exception because
> Oracle has no built in mechanism for identity key generation. This is
> probably the same reason forthis warning: WARN 2009-04-27 11:09:04 -
> System.ArgumentException: identifier type mismatch Parameter name: id.
>
> How are you defining id in your mappings? and are you using the same
> mappings for all of the DB dialects? Please can you post the mapping for
> the
> user_def table.
>
>
>
> On Apr 27, 9:35 am, "Anthony Dyer" <[email protected]>
> wrote:
> > I got the logging working.
> > I am getting this error:
> >
> > [ SELECT this_.user_nbr as user1_0_0_, this_.name_txt as name2_0_0_,
> > this_.pass_txt as pass3_0_0_, this_.email_txt as email4_0_0_,
> > this_.user_id as user5_0_0_, this_.style_txt as style6_0_0_,
> > this_.ldap_ind as ldap7_0_0_, this_.sys_user_id as sys8_0_0_ FROM
> > user_def this_ WHERE this_.user_nbr = ? ] Positional parameters:   0
> > 63
> >
> > System.ArgumentException: identifier type mismatch
> > Parameter name: id
> >    at NHibernate.Engine.EntityKey..ctor(Object id, Object
> > identifierSpace, Type clazz, IType identifierType, Boolean
> > isBatchLoadable, ISessionFactoryImplementor factory) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Engine\EntityKey.cs:lin
> > e 37
> >    at NHibernate.Engine.EntityKey..ctor(Object id, IEntityPersister p) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Engine\EntityKey.cs:line
> 54
> >    at NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i, ILoadable
> > persister, Object id, IDataReader rs, ISessionImplementor session) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 843
> >    at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet,
> > ISessionImplementor session, QueryParameters queryParameters, LockMode[]
> > lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects,
> > EntityKey[] keys, Boolean returnProxies) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 305
> >    at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
> > QueryParameters queryParameters, Boolean returnProxies) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 447
> >    at
> >
>
> NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImpl
> > ementor session, QueryParameters queryParameters, Boolean
> > returnProxies)
> in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line
> > 181
> >    at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> > QueryParameters queryParameters) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line
> 1792
> > WARN 2009-04-27 11:09:04 - System.ArgumentException: identifier type
> > mismatch
> > Parameter name: id
> >    at NHibernate.Engine.EntityKey..ctor(Object id, Object
> identifierSpace,
> > Type clazz, IType identifierType, Boolean isBatchLoadable,
> > ISessionFactoryImplementor factory) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Engine\EntityKey.cs:line
> 37
> >    at NHibernate.Engine.EntityKey..ctor(Object id, IEntityPersister p) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Engine\EntityKey.cs:line
> 54
> >    at NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i, ILoadable
> > persister, Object id, IDataReader rs, ISessionImplementor session) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 843
> >    at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet,
> > ISessionImplementor session, QueryParameters queryParameters, LockMode[]
> > lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects,
> > EntityKey[] keys, Boolean returnProxies) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 305
> >    at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
> > QueryParameters queryParameters, Boolean returnProxies) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line 447
> >    at
> >
>
> NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImpl
> > ementor session, QueryParameters queryParameters, Boolean
> > returnProxies)
> in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line
> > 181
> >    at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> > QueryParameters queryParameters) in
> > C:\DOWNLOAD\NHibernate\1.2.0.GA\src\NHibernate\Loader\Loader.cs:line
> 1792
> > ERROR2009-04-27 11:09:04 - identifier type mismatch
> >
> > I am not sure what it means- this is on a SELECT against an Oracle 11g
> > database.
> >
> > Anthony Dyer
> > Director of Technology, Transportation
> > (847) 954 4526 or (847) 699-6620
> > [email protected]
> >
> > -----Original Message-----
> > From: Anthony Dyer [mailto:[email protected]]
> > Sent: Monday, April 27, 2009 11:22 AM
> > To: '[email protected]'
> > Subject: RE: [nhusers] Re: Oracke Transaction
> >
> > Never mind- I got the logging working
> >
> > Anthony Dyer
> > Director of Technology, Transportation
> > (847) 954 4526 or (847) 699-6620
> > [email protected]
> >
> > -----Original Message-----
> > From: Anthony Dyer [mailto:[email protected]]
> > Sent: Monday, April 27, 2009 9:41 AM
> > To: '[email protected]'
> > Subject: RE: [nhusers] Re: Oracke Transaction
> >
> > I actually have a couple of questions
> >
> > I am trying to get debugging out of log4net - How do I get hibernate
> > to do logging? (we have nothing in the web.config for hibernate, do
> > have for
> > log4net)
> >
> > 2. this is the code that builds the hibernate.config:
> >
> > config.Properties.Add("hibernate.connection.provider",
> > "NHibernate.Connection.DriverConnectionProvider");
> >                         switch (connection.DatabaseType)
> >                         {
> >                                 case "SQL":
> >                                 {
> >
> > config.Properties.Add("hibernate.connection.driver_class",
> > "NHibernate.Driver.SqlClientDriver");
> >
> > config.Properties.Add("hibernate.dialect",
> > "NHibernate.Dialect.MsSql2000Dialect");
> >                                         break;
> >                                 }
> >                                 case "ORA":
> >                                 {
> >
> > config.Properties.Add("hibernate.connection.driver_class",
> > "NHibernate.Driver.OracleClientDriver");
> >
> > config.Properties.Add("hibernate.dialect",
> > "NHibernate.Dialect.OracleDialect");
> >                                         break;
> >                                 }
> >                                 case "DB2":
> >                                 {
> >
> > config.Properties.Add("hibernate.connection.driver_class",
> > "NHibernate.Driver.DB2Driver");
> >
> > config.Properties.Add("hibernate.dialect",
> > "NHibernate.Dialect.DB2Dialect");
> >                                         break;
> >                                 }
> >                                 default:
> >                                 {
> >                                         break;
> >                                 }
> >                         }
> >
> config.Properties.Add("hibernate.max_fetch_depth",
> > "-1");
> >
> > config.Properties.Add("hibernate.connection.connection_string",
> > connection.OrmConnectString);
> >
> > //config.Properties.Add("hibernate.use_reflection_optimizer",
> > "false");
> >                         config.Properties.Add("hibernate.show_sql",
> "true");
> >                         // add current assembly
> >                         this._nhibernateConfiguration =
> > config.AddAssembly(this.GetType().Assembly);
> >             // assembly loaded
> >                         config.SetInterceptor(new
> > Logility.Data.DaoInterceptor());
> >                         this._nhibernateFactory =
> > this._nhibernateConfiguration.BuildSessionFactory();
> >
> > And this is what it looks like after the logic has been processed:
> >
> > (see attached)
> >
> > But after I do the session.Open, I see:
> >
> > See second attachement (hibernate.session)
> >
> > Then when I do the session.BeginTransaction(); I get
> > (see third attachement 9 hibernate.transaction)
> > But the table does exist -
> > It should be referencing a synonym - but I can not see the actual SQL
> > statement (because of logging- which I can not get turned on)
> >
> > Any help will be much appreciated-
> >
> > thanks
> >
> > Anthony Dyer
> > Director of Technology, Transportation
> > (847) 954 4526 or (847) 699-6620
> > [email protected]
> >
> > -----Original Message-----
> > From: Anthony Dyer [mailto:[email protected]]
> > Sent: Sunday, April 26, 2009 1:23 PM
> > To: [email protected]
> > Subject: RE: [nhusers] Re: Oracke Transaction
> >
> > We are building the config dynamically in the program
> > Thanks for the reply-
> > I will have to check tomorrow
> > I did see where the dialect was being set - but not sure it is
> > correctly set
> >
> > Anthony Dyer
> > Director of Technology, Transportation
> > (847) 954 4526 or (847) 699-6620
> > [email protected]
> >
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On
> > Behalf Of mhanney
> > Sent: Sunday, April 26, 2009 11:35 AM
> > To: nhusers
> > Subject: [nhusers] Re: Oracke Transaction
> >
> > In your nhibernate.config for Oracle, do you have <property
> > name="connection.isolation"> set, and if so, what value is it set to?
> > Did you try <property name="connection.isolation">ReadCommitted</
> > property> ?
> >
> > On Apr 24, 11:37 am, AAD <[email protected]> wrote:
> > > I have a system that needs to interface with SQL Server or Oracle
> > > 11g. In the code, there is the following:
> >
> > > session = Data.DaoFactory.OpenSession(systemInstance);
> > > transaction = session.BeginTransaction();
> >
> > > when I run and am connected to SQL Server, the BeginTransaction()
> > > works fine, with I am connected to Oracle, I get an error:
> >
> > > +               IsolationLevel
> > > + '((NHibernate.Transaction.AdoTransaction)
> > > (transaction)).IsolationLevel' threw an exception of type
> > > 'System.Data.OracleClient.OracleException'
> > > System.Data.IsolationLevel
> > > {System.Data.OracleClient.OracleException}
> >
> > > any suggestion on how to go about debugging?
> >
> >
>
>
>
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to