That line wrapped: Session.Save(Session.Save(o)); // throws exception (No persister for: System.Int64)
Yes it seems very weird that would should essentially be the same line of code, one of them would fail. I'm having a related problem (I think) with this class in another place so I'm targeting this problem at first. On Oct 19, 11:08 pm, Fabio Maulo <[email protected]> wrote: > Are you joking ? Session.Save(Session.Save(o)); // throws exception > what you are expecting from that sentence ? > > 2009/10/19 Scott White <[email protected]> > > > > > > > What could go wrong that would cause NHibernate to not know the > > persister for intrinsic types like Int64? > > > exception: No persister for: System.Int64 > > > IList<Deposit> list = new List<Deposit>(); > > list.Add(new Deposit()); > > > foreach (Deposit o in list) > > { > > Session.Save(new Deposit()); // works > > Session.Save(Session.Save(o)); // throws exception > > (No persister for: System.Int64) > > > Stack Trace: > > " at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String > > entityName)\r\n at NHibernate.Impl.SessionImpl.GetEntityPersister > > (String entityName, Object obj)\r\n at > > NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId > > (Object entity, String entityName, Object anything, IEventSource > > source, Boolean requiresImmediateIdAccess)\r\n at > > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGenerated > > OrRequestedId > > (SaveOrUpdateEvent event)\r\n at > > > NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrReques > > tedId > > (SaveOrUpdateEvent event)\r\n at > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient > > (SaveOrUpdateEvent event)\r\n at > > NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate > > (SaveOrUpdateEvent event)\r\n at > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate > > (SaveOrUpdateEvent event)\r\n at NHibernate.Impl.SessionImpl.FireSave > > (SaveOrUpdateEvent event)\r\n at NHibernate.Impl.SessionImpl.Save > > (Object obj)\r\n at > > Company.CashManagement.Data.Test.CashTransactionDao_Tests.Initialize() > > in C:\\dev\\Portal\\src\\trunk\\Company.CashManagement.Data.Test\ > > \CashTransactionDao_Tests.cs:line 62" > > > MAPPING > > > <?xml version="1.0" encoding="utf-8"?> > > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> > > <class > > > name="Company.CashManagement.Domain.CashTransaction,Company.CashManagement. > > Domain" > > table="FactTransaction" mutable="false" discriminator-value="0"> > > <id name="Id" column="FactTransactionID" type="long"> > > <generator class="native" /> > > </id> > > <discriminator formula="case when DimTransactionTypeID in (3, 4) > > then 1 else 0 end" /> > > <!-- <discriminator column="DimTransactionTypeID" type="short" />-- > > > <property name="Agent" column="Agent" type="string" length="10" /> > > <property name="BranchId" column="BranchID" type="int" /> > > <property name="CheckCount" column="CheckCnt" type="int" not- > > null="true" /> > > <property name="Checks" column="Checks" type="Decimal" not- > > null="true" /> > > <property name="CoinTotal" column="CoinTotal" type="Decimal" not- > > null="true" /> > > <property name="CreatedDate" column="RecordCreateDateTime" > > type="DateTime" /> > > <property name="CreditedDate" column="CreditDate" type="DateTime" / > > > <property name="CurrencyTotal" column="CurrencyTotal" > > type="Decimal" not-null="true" /> > > <property name="CustomPrompt1" column="Custom_Prompt_1" > > type="int" /> > > <property name="CustomPrompt2" column="Custom_Prompt_2" > > type="int" /> > > <property name="CustomPrompt3" column="Custom_Prompt_3" > > type="int" /> > > <property name="CustomPrompt10" column="Custom_Prompt_10" > > type="int" /> > > <property name="CustomPrompt11" column="Custom_Prompt_11" > > type="int" /> > > <property name="DeclaredCash" column="DeclaredCash" > > type="Decimal" /> > > <property name="DeclaredItem" column="DeclaredItem" > > type="Decimal" /> > > <property name="DeclaredTotal" column="DeclaredTotal" > > type="Decimal" not-null="true" /> > > <property name="DenominationBase" column="DenominationBase" > > type="string" length="50" /> > > <property name="DepositId" column="DepositID" type="string" > > length="20" /> > > <property name="Difference" column="Difference" type="Decimal" not- > > null="true" /> > > <property name="EmployeeNumber" column="EmployeeNumber" > > type="int" /> > > <property name="EnvelopeCount" column="EnvelopeCnt" type="int" not- > > null="true" /> > > <property name="FoodStamps" column="FoodStamps" type="Decimal" not- > > null="true" /> > > <property name="IsMasterBag" column="IsMasterBag" type="Boolean" / > > > <property name="IsOffset" column="IsOffset" type="Boolean" /> > > <property name="LastModifiedDate" column="RecordUpdateDateTime" > > type="DateTime" /> > > <many-to-one name="Location" column="DimAccntLocID" /> > > <property name="LocationNumber" column="LocationNumber" > > type="long" /> > > <property name="LogDate" column="LogDate" type="date" /> > > <property name="LogTime" column="LogTime" type="time" /> > > <property name="LoosePiecesCountTotal" > > column="LoosePiecesCntTotal" type="long" not-null="true" /> > > <property name="Memo" column="Memo" type="string" length="100" /> > > <property name="MultiVaultId" column="MVID" type="long" /> > > <property name="NonStandardCoinBags" column="NonStandardCoinBags" > > type="int" not-null="true" /> > > <property name="OtherMisc" column="OtherMisc" type="Decimal" not- > > null="true" /> > > <property name="ProcessedDate" column="ProcessingDate" > > type="DateTime" /> > > <property name="ProcessedMode" column="ProcessMode" type="byte" /> > > <property name="SerialNo" column="SerialNo" type="string" > > length="10" /> > > <property name="StandardCoinBags" column="StandardCoinBags" > > type="int" not-null="true" /> > > <property name="ServicedDate" column="AccntLocDate" > > type="DateTime" /> > > <property name="StandardStrapsCount" column="StandardStraps" > > type="int" not-null="true" /> > > <property name="StrapPiecesCountTotal" > > column="StrapPiecesCntTotal" type="int" not-null="true" /> > > <property name="TraceNo" column="TraceNo" type="long" /> > > <property name="TraceNoMasterBag" column="TraceNo_MasterBag" > > type="long" /> > > <property name="TraceNoMbd" column="TraceNo_MBD" type="long" /> > > <property name="TransactionTypeId" column="DimTransactionTypeID" > > type="short" not-null="true" /> > > <property name="VerifiedCash" column="VerifiedCash" type="Decimal" > > not-null="true" /> > > <property name="VerifiedTotal" column="VerifiedTotal" > > type="Decimal" not-null="true" /> > > <property name="WrappedCoinCount" column="WrappedCoinCount" > > type="int" not-null="true" /> > > > <bag name="ReasonCodes" inverse="true"> > > <key column="FactTransactionID" /> > > <one-to-many > > > class="Company.CashManagement.Domain.ReasonCode,Company.CashManagement.Doma > > in"/ > > > </bag> > > > <!-- Components --> > > <component name="DenominationalBillAmounts" > > > class="Company.CashManagement.Domain.DenominationalBillAmount,Company.CashM > > anagement.Domain"> > > <property name="One" column="Bill_0001_00" type="Decimal" not- > > null="true" /> > > <property name="Two" column="Bill_0002_00" type="Decimal" not- > > null="true" /> > > <property name="Five" column="Bill_0005_00" type="Decimal" not- > > null="true" /> > > <property name="Ten" column="Bill_0010_00" type="Decimal" not- > > null="true" /> > > <property name="Twenty" column="Bill_0020_00" type="Decimal" not- > > null="true" /> > > <property name="Fifty" column="Bill_0050_00" type="Decimal" not- > > null="true" /> > > <property name="OneHundred" column="Bill_0100_00" type="Decimal" > > not-null="true" /> > > <property name="TwoHundred" column="Bill_0200_00" type="Decimal" > > not-null="true" /> > > <property name="FiveHundred" column="Bill_0500_00" > > type="Decimal" not-null="true" /> > > <property name="OneThousand" column="Bill_1000_00" > > type="Decimal" not-null="true" /> > > </component> > > <component name="DenominationalCoinAmounts" > > > class="Company.CashManagement.Domain.DenominationalCoinAmount,Company.CashM > > anagement.Domain"> > > <property name="Loose" column="Coin_Loose" type="Decimal" not- > > null="true" /> > > <property name="Penny" column="Coin_0000_01" type="Decimal" not- > > null="true" /> > > <property name="Nickel" column="Coin_0000_05" type="Decimal" not- > > null="true" /> > > <property name="Dime" column="Coin_0000_10" type="Decimal" not- > > null="true" /> > > <property name="Quarter" column="Coin_0000_25" type="Decimal" > > not-null="true" /> > > <property name="FiftyCentPiece" column="Coin_0000_50" > > type="Decimal" not-null="true" /> > > <property name="DollarPiece" column="Coin_0001_00" > > type="Decimal" not-null="true" /> > > </component> > > <component name="DenominationalFoodStampAmounts" > > > class="Company.CashManagement.Domain.DenominationalFoodStampAmount,Company. > > CashManagement.Domain"> > > <property name="One" column="FS_0001_00" type="Decimal" not- > > null="true" /> > > <property name="Five" column="FS_0005_00" type="Decimal" not- > > null="true" /> > > <property name="Ten" column="FS_0010_00" type="Decimal" not- > > null="true" /> > > <property name="Loose" column="FS_Loose" type="Decimal" not- > > null="true" /> > > </component> > > <component name="DenominationalNoteCounts" > > > class="Company.CashManagement.Domain.DenominationalNoteCount,Company.CashMa > > nagement.Domain"> > > <property name="One" column="note_count_1" type="int" not- > > null="true" /> > > <property name="Two" column="note_count_2" type="int" not- > > null="true" /> > > <property name="Five" column="note_count_5" type="int" not- > > null="true" /> > > <property name="Ten" column="note_count_10" type="int" not- > > null="true" /> > > <property name="Twenty" column="note_count_20" type="int" not- > > null="true" /> > > <property name="Fifty" column="note_count_50" type="int" not- > > null="true" /> > > <property name="Hundred" > > ... > > read more » --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
