Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: reading and replacing the ini files using c# Pin
varsh1223-Jul-10 2:17
varsh1223-Jul-10 2:17 
GeneralRe: reading and replacing the ini files using c# Pin
Luc Pattyn23-Jul-10 2:38
sitebuilderLuc Pattyn23-Jul-10 2:38 
AnswerRe: reading and replacing the ini files using c# Pin
PIEBALDconsult23-Jul-10 5:16
mvePIEBALDconsult23-Jul-10 5:16 
QuestionTriggering an event from another class? Pin
faheemnadeem23-Jul-10 0:54
faheemnadeem23-Jul-10 0:54 
AnswerRe: Triggering an event from another class? Pin
Samuel Cherinet23-Jul-10 3:23
Samuel Cherinet23-Jul-10 3:23 
AnswerRe: Triggering an event from another class? Pin
DaveyM6923-Jul-10 6:09
professionalDaveyM6923-Jul-10 6:09 
AnswerRe: Triggering an event from another class? Pin
faheemnadeem23-Jul-10 6:21
faheemnadeem23-Jul-10 6:21 
QuestionnHibernate Commit throws OutOfMemoryException Pin
spit_spit_spit_spit22-Jul-10 23:40
spit_spit_spit_spit22-Jul-10 23:40 
Hi,

I'm having a big problem with a "data importer" code.
I'm working on this data importer since January and never have any problem before. The big difference is just that there is more data to load now than in january. And each entity is bigger (more properties)

I'm using .NET 3.5 C# nHibernate & spring

The exception is:

Exception of type 'System.OutOfMemoryException' was thrown. ------- at System.Collections.Generic.Dictionary`2.Resize()
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
at NHibernate.Event.Default.AbstractFlushingEventListener.PostFlush(ISessionImplementor session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at PagesJaunes.Adnc.DataAccess.Repositories.Repository`1.CommitTransaction()


There is a total of 500 000 entities to save.
My code is saving 10 000 entities, then commit and start a new transaction for the next 10 000
It take nearly 12 hours to save everything, and after ~400 000 entites i receive my OutOfMemoryException

I already try lots of things, can anyone help me having new ideas ?

- i tried to commit each 100 entites or each 1000 entites.
- i tried to call GC.Collect regularly
- if a commit throw the exception, i tried to rollback and start a new one. but then each commit throw the f** exception, no matter what.
- googling since 2 days and i can't find anything on this subject
- now i'm trying to do a commit/flush/clear each 10 000 entites (it's running i don't know the result yet)

--
Nicolas
AnswerRe: nHibernate Commit throws OutOfMemoryException Pin
Luc Pattyn23-Jul-10 2:50
sitebuilderLuc Pattyn23-Jul-10 2:50 
QuestionHow can i convert all types of files to pdf format without using any software? Pin
sush822-Jul-10 22:54
sush822-Jul-10 22:54 
JokeRe: How can i convert all types of files to pdf format without using any software? Pin
Łukasz Nowakowski22-Jul-10 23:05
Łukasz Nowakowski22-Jul-10 23:05 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
sush822-Jul-10 23:26
sush822-Jul-10 23:26 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Łukasz Nowakowski22-Jul-10 23:31
Łukasz Nowakowski22-Jul-10 23:31 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Sauro Viti22-Jul-10 23:32
professionalSauro Viti22-Jul-10 23:32 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Eddy Vluggen22-Jul-10 23:39
professionalEddy Vluggen22-Jul-10 23:39 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
sush822-Jul-10 23:50
sush822-Jul-10 23:50 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Dave Kreskowiak23-Jul-10 1:48
mveDave Kreskowiak23-Jul-10 1:48 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Eddy Vluggen23-Jul-10 2:04
professionalEddy Vluggen23-Jul-10 2:04 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
sush823-Jul-10 7:12
sush823-Jul-10 7:12 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Eddy Vluggen23-Jul-10 7:41
professionalEddy Vluggen23-Jul-10 7:41 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
sush824-Jul-10 1:21
sush824-Jul-10 1:21 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
Eddy Vluggen24-Jul-10 1:43
professionalEddy Vluggen24-Jul-10 1:43 
GeneralRe: How can i convert all types of files to pdf format without using any software? Pin
sush824-Jul-10 3:53
sush824-Jul-10 3:53 
AnswerRe: How can i convert all types of files to pdf format without using any software? Pin
Sauro Viti22-Jul-10 23:09
professionalSauro Viti22-Jul-10 23:09 
Questioncode for checkbox Pin
kolisa22-Jul-10 21:58
kolisa22-Jul-10 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.