NHibernate with MySql
We are getting a major prob when inserting orders, the Identity is not getting returned from NH - I've enclosed the logs below to see if anyone can spot whats happening
this ONLY happens when we first upload the DLL's after the error, close the browser and re-open and orders can be saved OK
Any ideas? Let me know if u need anything else posting up
Thanks
Adam
2008-06-21 19:08:57,442 DEBUG NHibernate.SQL INSERT INTO Orders (PostedToAccounts, OrderDate, ShippingPrice, ShippingName, InstallationRequired, TermsAccepted, SalesOrderNumber, CustomerOrderNumber, BillingTitle, BillingForename, BillingSurname, BillingCompany, BillingAddress1, BillingAddress2, BillingTown, BillingCounty, BillingPostcode, BillingCountry, BillingEmail, BillingTelephone, BillingMobile, BillingFax, DeliveryTitle, DeliveryForename, DeliverySurname, DeliveryCompany, DeliveryAddress1, DeliveryAddress2, DeliveryTown, DeliveryCounty, DeliveryPostcode, DeliveryCountry, DeliveryCountryCode, DeliveryEmail, DeliveryTelephone, DeliveryMobile, DeliveryFax, PaymentMethod, PaymentStatus, ThirdPartyCartIdentifier, ThirdPartyTransactionCode, ThirdPartyTransactionId, ThirdPartySecurityKey, TransactionId, SiteId, AccountId) VALUES (?p0, ?p1, ?p2, ?p3, ?p4, ?p5, ?p6, ?p7, ?p8, ?p9, ?p10, ?p11, ?p12, ?p13, ?p14, ?p15, ?p16, ?p17, ?p18, ?p19, ?p20, ?p21, ?p22, ?p23, ?p24, ?p25, ?p26, ?p27, ?p28, ?p29, ?p30, ?p31, ?p32, ?p33, ?p34, ?p35, ?p36, ?p37, ?p38, ?p39, ?p40, ?p41, ?p42, ?p43, ?p44, ?p45); ?p0 = 'False', ?p1 = '6/21/2008 7:08:57 PM', ?p2 = '0', ?p3 = 'Mixed Order Carriage at cost (above £20.00 below £450.00)', ?p4 = 'False', ?p5 = 'True', ?p6 = '', ?p7 = '', ?p8 = 'Mr', ?p9 = 'Paul', ?p10 = 'Test', ?p11 = 'website Ltd', ?p12 = '6-8 Test Square', ?p13 = '', ?p14 = 'Newcastle upon Tyne', ?p15 = 'Tyne and Wear', ?p16 = 'NE99 4XF', ?p17 = 'United Kingdom', ?p18 =
'paul@website.co.uk', ?p19 = '012132123', ?p20 = '213321321', ?p21 = '231321321', ?p22 = 'Mr', ?p23 = 'Paul', ?p24 = 'Test', ?p25 = 'website Ltd', ?p26 = '6-8 Test Square', ?p27 = '', ?p28 = 'Newcastle upon Tyne', ?p29 = 'Tyne and Wear', ?p30 = 'NE99 4XF', ?p31 = 'United Kingdom', ?p32 = '', ?p33 =
'paul@website.co.uk', ?p34 = '012132123', ?p35 = '213321321', ?p36 = '231321321', ?p37 = 'PAYMENT_ON_ACCOUNT', ?p38 = 'PENDING', ?p39 = '', ?p40 = '', ?p41 = '', ?p42 = '', ?p43 = '', ?p44 = '3', ?p45 = '10'
2008-06-21 19:08:57,457 DEBUG NHibernate.Connection.DriverConnectionProvider Obtaining IDbConnection from Driver
2008-06-21 19:08:57,457 DEBUG NHibernate.AdoNet.AbstractBatcher Closed IDbCommand, open IDbCommands: 0
2008-06-21 19:08:57,457 DEBUG NHibernate.AdoNet.ConnectionManager aggressively releasing database connection
2008-06-21 19:08:57,457 DEBUG NHibernate.Connection.ConnectionProvider Closing connection
2008-06-21 19:08:57,457 DEBUG NHibernate.AdoNet.AbstractBatcher Opened new IDbCommand, open IDbCommands: 1
2008-06-21 19:08:57,473 DEBUG NHibernate.AdoNet.AbstractBatcher Building an IDbCommand object for the SqlString: SELECT LAST_INSERT_ID()
2008-06-21 19:08:57,473 DEBUG NHibernate.SQL SELECT LAST_INSERT_ID()
2008-06-21 19:08:57,473 DEBUG NHibernate.Connection.DriverConnectionProvider Obtaining IDbConnection from Driver
2008-06-21 19:08:57,473 DEBUG NHibernate.AdoNet.AbstractBatcher Opened IDataReader, open IDataReaders: 1
>>> WHY DOES THIS HAPPEN >>>
2008-06-21 19:08:57,473 DEBUG NHibernate.Type.Int32Type returning '0' as column: LAST_INSERT_ID()
<<<<
2008-06-21 19:08:57,473 DEBUG NHibernate.Id.IdentifierGeneratorFactory Natively generated identity: 0
2008-06-21 19:08:57,473 DEBUG NHibernate.AdoNet.AbstractBatcher Closed IDbCommand, open IDbCommands: 0
2008-06-21 19:08:57,473 DEBUG NHibernate.AdoNet.ConnectionManager skipping aggressive-release due to open resources on batcher