-->
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.  [ 2 posts ] 
Author Message
 Post subject: Trying the "Quick start guide" with Sybase - Failu
PostPosted: Mon Jul 23, 2007 5:11 am 
Newbie

Joined: Sun Jul 22, 2007 6:31 am
Posts: 1
Hi, I'm keen to use NHibernate in my next RAD project, even if I'm somewhat concerned about the loss of the lead developer and the less than perfect support of Sybase.

After repeatedly running into problems "getting started", I went back to basics and tried to get the Quick Start Guide to run in my current environment. Some trivial changes were made to the mapping xml (Schema URN, lazy flag) to be able to open a session, alas, the commit wouldn't work.

Please take a look, and tell me the source of the problem

- Is it me/a trivial error?
- Is it the capabilities of the Sybase driver/dialect?


Hibernate version:
1.2.0

Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="EquityImporter.DataAccess.PdbCod.ostest, EquityImporter" table="ostest" lazy="false">
<id name="Id" column="LogonID" type="String" length="20">
<generator class="assigned" />
</id>
<property name="UserName" column="Name" type="String" length="40"/>
<property name="Password" type="String" length="20"/>
<property name="EmailAddress" type="String" length="40"/>
<property name="LastLogon" type="DateTime"/>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():

Configuration cfg = new Configuration();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();



ostest newUser = new ostest();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "joe@cool.com";
newUser.LastLogon = DateTime.Now;

// Tell NHibernate that this object should be saved
session.Save(newUser);

// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();

// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();

Full stack trace of any exception that occurs:

NHibernate.ADOException was unhandled
Message="could not insert: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool][SQL: INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (?, ?, ?, ?, ?)]"
Source="NHibernate"
StackTrace:
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Impl.ScheduledInsertion.Execute()
at NHibernate.Impl.SessionImpl.Execute(IExecutable executable)
at NHibernate.Impl.SessionImpl.ExecuteAll(IList list)
at NHibernate.Impl.SessionImpl.Execute()
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at EquityImporter.Form1.button2_Click(Object sender, EventArgs e) in \\RSC\DFS$\DZ_HOMES\XNE0133\Visual Studio 2005\Projects\EquityImporter\EquityImporter\Form1.cs:line 194
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at EquityImporter.Program.Main() in \\RSC\DFS$\DZ_HOMES\XNE0133\Visual Studio 2005\Projects\EquityImporter\EquityImporter\Program.cs:line 20
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


Name and version of the database you are using:
Sybase ASE 12.5.3


The generated SQL (show_sql=true):
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'Joseph Cool' to parameter: 0
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'abc123' to parameter: 1
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'joe@cool.com' to parameter: 2
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.DateTimeType binding '07/23/2007' to parameter: 3
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'joe_cool' to parameter: 4
2007-07-23 10:56:24,548 [11] DEBUG NHibernate.SQL INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (@p0, @p1, @p2, @p3, @p4); @p0 = 'Joseph Cool', @p1 = 'abc123', @p2 = 'joe@cool.com', @p3 = '07/23/2007 10:56:17', @p4 = 'joe_cool'
NHibernate: INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (@p0, @p1, @p2, @p3, @p4); @p0 = 'Joseph Cool', @p1 = 'abc123', @p2 = 'joe@cool.com', @p3 = '07/23/2007 10:56:17', @p4 = 'joe_cool'
2007-07-23 10:56:24,579 [11] DEBUG NHibernate.Impl.BatcherImpl Closed IDbCommand, open IDbCommands: 0
2007-07-23 10:56:24,595 [11] DEBUG NHibernate.Util.ADOExceptionReporter could not insert: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool] [INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (?, ?, ?, ?, ?)]
Sybase.Data.AseClient.AseException: Attempt to insert NULL value into column 'LogonID', table 'PDB2.dbo.ostest'; column does not allow nulls. Update fails.


Debug level Hibernate log excerpt:

[Header]%newline2007-07-23 10:56:09,876 [11] INFO NHibernate.Cfg.Environment NHibernate 1.2.0.4000 (1.2.0.4000)
2007-07-23 10:56:09,907 [11] INFO NHibernate.Cfg.Environment Bytecode provider name : lcg
2007-07-23 10:56:09,907 [11] INFO NHibernate.Cfg.Environment Using reflection optimizer
2007-07-23 10:56:09,923 [11] INFO NHibernate.Cfg.Configuration Searching for mapped documents in assembly: EquityImporter
2007-07-23 10:56:09,954 [11] INFO NHibernate.Cfg.Configuration Adding embedded mapping document: EquityImporter.DataAccess.PdbCod.ostest.hbm.xml
2007-07-23 10:56:09,954 [11] INFO NHibernate.Cfg.Configuration Mapping resource: EquityImporter.DataAccess.PdbCod.ostest.hbm.xml
2007-07-23 10:56:10,032 [11] INFO NHibernate.Dialect.Dialect Using dialect: NHibernate.Dialect.SybaseDialect
2007-07-23 10:56:10,079 [11] INFO NHibernate.Cfg.HbmBinder Mapping class: EquityImporter.DataAccess.PdbCod.ostest -> ostest
2007-07-23 10:56:10,142 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: Id -> LogonID, type: String
2007-07-23 10:56:10,157 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: UserName -> Name, type: String
2007-07-23 10:56:10,157 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: Password -> Password, type: String
2007-07-23 10:56:10,157 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: EmailAddress -> EmailAddress, type: String
2007-07-23 10:56:10,157 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: LastLogon -> LastLogon, type: DateTime
2007-07-23 10:56:10,157 [11] INFO NHibernate.Cfg.Configuration Adding embedded mapping document: EquityImporter.DataAccess.PdbCod.TradeData.hbm.xml
2007-07-23 10:56:10,157 [11] INFO NHibernate.Cfg.Configuration Mapping resource: EquityImporter.DataAccess.PdbCod.TradeData.hbm.xml
2007-07-23 10:56:10,157 [11] INFO NHibernate.Dialect.Dialect Using dialect: NHibernate.Dialect.SybaseDialect
2007-07-23 10:56:10,157 [11] INFO NHibernate.Cfg.HbmBinder Mapping class: EquityImporter.DataAccess.PdbCod.TradeData -> PDBCODTradeData
2007-07-23 10:56:10,173 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: Id -> Id, type: Int64
2007-07-23 10:56:10,173 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: TradeId -> TradeId, type: String
2007-07-23 10:56:10,173 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: KeyId -> KeyId, type: Int64
2007-07-23 10:56:10,173 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: Index1 -> Index1, type: Int64
2007-07-23 10:56:10,173 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: Value1 -> Value1, type: String
2007-07-23 10:56:10,376 [11] DEBUG NHibernate.Cfg.HbmBinder Mapped property: PoetKeyString -> PoetKeyString, type: String
2007-07-23 10:56:10,376 [11] INFO NHibernate.Cfg.Configuration processing one-to-many association mappings
2007-07-23 10:56:10,376 [11] INFO NHibernate.Cfg.Configuration processing one-to-one association property references
2007-07-23 10:56:10,376 [11] INFO NHibernate.Cfg.Configuration processing foreign key constraints
2007-07-23 10:56:10,407 [11] INFO NHibernate.Dialect.Dialect Using dialect: NHibernate.Dialect.SybaseDialect
2007-07-23 10:56:10,407 [11] INFO NHibernate.Connection.ConnectionProviderFactory Initializing connection provider: NHibernate.Connection.DriverConnectionProvider
2007-07-23 10:56:10,407 [11] INFO NHibernate.Connection.ConnectionProvider Configuring ConnectionProvider
2007-07-23 10:56:10,439 [11] INFO NHibernate.Cfg.SettingsFactory Optimize cache for minimal puts: False
2007-07-23 10:56:10,611 [11] INFO NHibernate.Cfg.SettingsFactory Connection release mode: auto
2007-07-23 10:56:10,611 [11] INFO NHibernate.Cfg.SettingsFactory echoing all SQL to stdout
2007-07-23 10:56:10,611 [11] INFO NHibernate.Cfg.SettingsFactory Query translator: NHibernate.Hql.Classic.ClassicQueryTranslatorFactory
2007-07-23 10:56:10,611 [11] INFO NHibernate.Cfg.SettingsFactory Query language substitutions: {}
2007-07-23 10:56:10,611 [11] INFO NHibernate.Cfg.SettingsFactory cache provider: NHibernate.Cache.NoCacheProvider, NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
2007-07-23 10:56:10,626 [11] INFO NHibernate.Impl.SessionFactoryImpl building session factory
2007-07-23 10:56:10,626 [11] DEBUG NHibernate.Impl.SessionFactoryImpl instantiating session factory with properties: {hibernate.connection.driver_class=NHibernate.Driver.SybaseClientDriver, hibernate.dialect=NHibernate.Dialect.SybaseDialect, hibernate.connection.provider=NHibernate.Connection.DriverConnectionProvider, hibernate.use_reflection_optimizer=true, hibernate.show_sql=true, hibernate.connection.connection_string=Data Source='dfrsitmars2';Port='60001';UID='pdb2';PWD='saeco0';Database='PDB2';}
2007-07-23 10:56:10,970 [11] DEBUG NHibernate.Impl.SessionFactoryObjectFactory initializing class SessionFactoryObjectFactory
2007-07-23 10:56:10,970 [11] DEBUG NHibernate.Impl.SessionFactoryObjectFactory registered: 033385895e714b9599e3b65555e52815(unnamed)
2007-07-23 10:56:10,970 [11] INFO NHibernate.Impl.SessionFactoryObjectFactory no name configured
2007-07-23 10:56:11,126 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.ostest: SELECT ostest0_.LogonID as LogonID0_0_, ostest0_.Name as Name0_0_, ostest0_.Password as Password0_0_, ostest0_.EmailAddress as EmailAdd4_0_0_, ostest0_.LastLogon as LastLogon0_0_ FROM ostest ostest0_ WHERE ostest0_.LogonID=?
2007-07-23 10:56:11,126 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.ostest: SELECT ostest0_.LogonID as LogonID0_0_, ostest0_.Name as Name0_0_, ostest0_.Password as Password0_0_, ostest0_.EmailAddress as EmailAdd4_0_0_, ostest0_.LastLogon as LastLogon0_0_ FROM ostest ostest0_ WHERE ostest0_.LogonID=?
2007-07-23 10:56:11,157 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.ostest: SELECT ostest0_.LogonID as LogonID0_0_, ostest0_.Name as Name0_0_, ostest0_.Password as Password0_0_, ostest0_.EmailAddress as EmailAdd4_0_0_, ostest0_.LastLogon as LastLogon0_0_ FROM ostest ostest0_ WHERE ostest0_.LogonID=?
2007-07-23 10:56:11,157 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.ostest: SELECT ostest0_.LogonID as LogonID0_0_, ostest0_.Name as Name0_0_, ostest0_.Password as Password0_0_, ostest0_.EmailAddress as EmailAdd4_0_0_, ostest0_.LastLogon as LastLogon0_0_ FROM ostest ostest0_ WHERE ostest0_.LogonID=?
2007-07-23 10:56:11,376 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.TradeData: SELECT tradedata0_.Id as Id1_0_, tradedata0_.TradeId as TradeId1_0_, tradedata0_.KeyId as KeyId1_0_, tradedata0_.Index1 as Index4_1_0_, tradedata0_.Value1 as Value5_1_0_, tradedata0_.PoetKeyString as PoetKeyS6_1_0_ FROM PDBCODTradeData tradedata0_ WHERE tradedata0_.Id=?
2007-07-23 10:56:11,376 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.TradeData: SELECT tradedata0_.Id as Id1_0_, tradedata0_.TradeId as TradeId1_0_, tradedata0_.KeyId as KeyId1_0_, tradedata0_.Index1 as Index4_1_0_, tradedata0_.Value1 as Value5_1_0_, tradedata0_.PoetKeyString as PoetKeyS6_1_0_ FROM PDBCODTradeData tradedata0_ WHERE tradedata0_.Id=?
2007-07-23 10:56:11,376 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.TradeData: SELECT tradedata0_.Id as Id1_0_, tradedata0_.TradeId as TradeId1_0_, tradedata0_.KeyId as KeyId1_0_, tradedata0_.Index1 as Index4_1_0_, tradedata0_.Value1 as Value5_1_0_, tradedata0_.PoetKeyString as PoetKeyS6_1_0_ FROM PDBCODTradeData tradedata0_ WHERE tradedata0_.Id=?
2007-07-23 10:56:11,579 [11] DEBUG NHibernate.Loader.Entity.AbstractEntityLoader Static select for entity EquityImporter.DataAccess.PdbCod.TradeData: SELECT tradedata0_.Id as Id1_0_, tradedata0_.TradeId as TradeId1_0_, tradedata0_.KeyId as KeyId1_0_, tradedata0_.Index1 as Index4_1_0_, tradedata0_.Value1 as Value5_1_0_, tradedata0_.PoetKeyString as PoetKeyS6_1_0_ FROM PDBCODTradeData tradedata0_ WHERE tradedata0_.Id=?
2007-07-23 10:56:11,579 [11] DEBUG NHibernate.Impl.SessionFactoryImpl Instantiated session factory
2007-07-23 10:56:11,595 [11] DEBUG NHibernate.Impl.SessionImpl opened session
2007-07-23 10:56:11,595 [11] DEBUG NHibernate.Transaction.AdoTransaction begin
2007-07-23 10:56:11,595 [11] DEBUG NHibernate.Connection.DriverConnectionProvider Obtaining IDbConnection from Driver
2007-07-23 10:56:17,782 [11] DEBUG NHibernate.Impl.SessionImpl generated identifier: joe_cool
2007-07-23 10:56:17,798 [11] DEBUG NHibernate.Impl.SessionImpl saving [EquityImporter.DataAccess.PdbCod.ostest#joe_cool]
2007-07-23 10:56:24,110 [11] DEBUG NHibernate.Transaction.AdoTransaction commit
2007-07-23 10:56:24,110 [11] DEBUG NHibernate.Impl.SessionImpl flushing session
2007-07-23 10:56:24,126 [11] DEBUG NHibernate.Impl.SessionImpl Flushing entities and processing referenced collections
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.SessionImpl Processing unreferenced collections
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.SessionImpl scheduling collection removes/(re)creates/updates
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.SessionImpl Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.SessionImpl Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.Printer listing entities:
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.Printer EquityImporter.DataAccess.PdbCod.ostest{UserName=Joseph Cool, EmailAddress=joe@cool.com, LastLogon=07/23/2007, Id=joe_cool, Password=abc123}
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.SessionImpl executing flush
2007-07-23 10:56:24,142 [11] DEBUG NHibernate.Impl.ConnectionManager registering flush begin
2007-07-23 10:56:24,157 [11] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister Inserting entity: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool]
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Impl.BatcherImpl Opened new IDbCommand, open IDbCommands: 1
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Impl.BatcherImpl Building an IDbCommand object for the SqlString: INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (?, ?, ?, ?, ?)
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister Dehydrating entity: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool]
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'Joseph Cool' to parameter: 0
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'abc123' to parameter: 1
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'joe@cool.com' to parameter: 2
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.DateTimeType binding '07/23/2007' to parameter: 3
2007-07-23 10:56:24,360 [11] DEBUG NHibernate.Type.StringType binding 'joe_cool' to parameter: 4
2007-07-23 10:56:24,548 [11] DEBUG NHibernate.SQL INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (@p0, @p1, @p2, @p3, @p4); @p0 = 'Joseph Cool', @p1 = 'abc123', @p2 = 'joe@cool.com', @p3 = '07/23/2007 10:56:17', @p4 = 'joe_cool'
2007-07-23 10:56:24,579 [11] DEBUG NHibernate.Impl.BatcherImpl Closed IDbCommand, open IDbCommands: 0
2007-07-23 10:56:24,595 [11] DEBUG NHibernate.Util.ADOExceptionReporter could not insert: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool] [INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (?, ?, ?, ?, ?)]
Sybase.Data.AseClient.AseException: Attempt to insert NULL value into column 'LogonID', table 'PDB2.dbo.ostest'; column does not allow nulls. Update fails.

at Sybase.Data.AseClient.AseCommand.CheckResult(Int32 res)
at Sybase.Data.AseClient.AseCommand.Execute()
at Sybase.Data.AseClient.AseCommand.ExecuteNonQuery()
at NHibernate.Impl.BatcherImpl.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
2007-07-23 10:56:24,751 [11] WARN NHibernate.Util.ADOExceptionReporter Sybase.Data.AseClient.AseException: Attempt to insert NULL value into column 'LogonID', table 'PDB2.dbo.ostest'; column does not allow nulls. Update fails.

at Sybase.Data.AseClient.AseCommand.CheckResult(Int32 res)
at Sybase.Data.AseClient.AseCommand.Execute()
at Sybase.Data.AseClient.AseCommand.ExecuteNonQuery()
at NHibernate.Impl.BatcherImpl.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
2007-07-23 10:56:24,954 [11] ERROR NHibernate.Util.ADOExceptionReporter Attempt to insert NULL value into column 'LogonID', table 'PDB2.dbo.ostest'; column does not allow nulls. Update fails.

2007-07-23 10:56:24,970 [11] ERROR NHibernate.Impl.SessionImpl could not synchronize database state with session
NHibernate.ADOException: could not insert: [EquityImporter.DataAccess.PdbCod.ostest#joe_cool][SQL: INSERT INTO ostest (Name, Password, EmailAddress, LastLogon, LogonID) VALUES (?, ?, ?, ?, ?)] ---> Sybase.Data.AseClient.AseException: Attempt to insert NULL value into column 'LogonID', table 'PDB2.dbo.ostest'; column does not allow nulls. Update fails.

at Sybase.Data.AseClient.AseCommand.CheckResult(Int32 res)
at Sybase.Data.AseClient.AseCommand.Execute()
at Sybase.Data.AseClient.AseCommand.ExecuteNonQuery()
at NHibernate.Impl.BatcherImpl.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
--- End of inner exception stack trace ---
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Impl.ScheduledInsertion.Execute()
at NHibernate.Impl.SessionImpl.Execute(IExecutable executable)
at NHibernate.Impl.SessionImpl.ExecuteAll(IList list)
at NHibernate.Impl.SessionImpl.Execute()
2007-07-23 10:56:26,173 [11] DEBUG NHibernate.Impl.ConnectionManager registering flush end
[url][/url]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 23, 2007 8:58 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The error message is weird - I'm even inclined to blame the driver since from the logs it's clear that the parameter is being set to a value, and yet the database complains about the value being null.

Or it might be related to http://jira.nhibernate.org/browse/NH-1052.


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

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.