|
You are not paying attention. Or you are not bothering to understand transactions.
Begin Transaction
Start File Loop
Start Data Chunk Loop
Read upto 10,000 records from file
Write those records to the database
End Data Chunk Loop
End File Loop
End Transaction
Each iteration around the Data Chunk Loop has one communication with the database (One "shot" per iteration)
If you have a million records you have 100 "shots" at writing to the database.
|
|
|
|
|
Thanks for your quick reply,
But,
Colin Angus Mackay wrote:
If you have a million records you have 100 "shots" at writing to the database.
Is this strategy fast enough , because to write 25 files it would take approx.
25 * 100= 2500 shots
Means 2500 iteration will be performed for writing 25 files.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Well, your choice is going slightly slower, use SSIS (as someone else suggested) or running out of memory - You choose! I give up.
|
|
|
|
|
Well first of all thanks for your valuable suggestions but as you are MVP and you say
Colin Angus Mackay wrote: I give up.
But Something for you.
Sam Ewing: It's not the hours you put in your work that count, it's work you put in the hours.
F. Scott Fitzgerald: You don't write because you want to say something; you write because you've got something to say.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
He gave up because you're an asshat.
Be a programmer for god's sake, and implement a solution.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: asshat
Thank you very very much A**Hole
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
You're arguing with the guy that gave you a solution. Who here is the a**hole?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Tell me where do i argued, i say thanks to his valuable suggestions and is my questions are pointless , no not they are. if he doesn't say anything to me then y your azz is itching.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Mogaambo wrote: Well first of all thanks for your valuable suggestions but as you are MVP and you say
Colin Angus Mackay wrote:
I give up.
But Something for you.
How about this. He's good at what he does because he recognizes that to keep working on a futile solution is a pointless.
|
|
|
|
|
|
Mogaambo wrote: more fast then previous one
Probably because you are not thrashing the virtual memory's page file.
|
|
|
|
|
Mogaambo wrote: Yes I did , but check yourself what answers i received, are they fruitful
no no no no
Uhhh, yes they are. And you were told exactly why your approach wouldn't work. You simply ARE running the machine out of memory trying to read and retain all that data at once. You have no choice but to either read and process the data in small chunks, or farm the entire job out to SQL Server to do it for you.
|
|
|
|
|
Hello everyone,
I am designing a library which client side could use it to retrieve content from a remote cache server, through Http/Web Services communication.
My current issues and concerns are,
- I want to let client side library to start multiple threads to work efficiently to request for multiple content at the same time other than a single thread pattern;
- But I do not want to hit the server too hard and I also do not want to the library to consume too much resources (memory/threads) on client side to block other work of the client. The library is delivered as a DLL, so loaded into client side process, and will compete for resources of the same process.
Are there any good design patterns for such issues?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Are there any good design patterns for such issues?
Hello George. At this point it is difficult to believe that you even comprehend what Design Patterns are. If you are asking if there is some magical solution for using threads that will absolve you, the developer, from responsibility to ensure the very requirements you speak of, the answer is NO. The developer has to actually know what they are doing and do it in a way that will achieve the requirements.
That said, the history of your posts, as far as I can tell, does not indicate that you are prepared to undertake a multi-threaded project. However I imagine that you will do so none the less. Logically we can expect to see many many future threads from you wondering why your multi-threading code doesn't work.
led mike
|
|
|
|
|
Thanks led mike,
My current situation is,
1. I can create many threads on client side to get data from server as fast as possible, but it may hit server too hard -- like DoS attack;
2. I can limit the number of threads of client side, in this situation server is not hit too hard, but client may not get data very efficiently.
I want to find solution to balance such situation. Any ideas?
regards,
George
|
|
|
|
|
George_George wrote: I can create many threads on client side to get data from server as fast as possible
You can? Really? Why because your client machine has unlimited processors? What vendor did you buy that from? I really need to get me one of those!
George, pay attention. You cannot learn about multi-threading in 5 minutes. Furthermore people have written entire books on the subject because that's how large and difficult the subject is, so why would I, or anyone else, attempt to provide an explanation in an internet forum? Wouldn't the be illogical?
If you don't have access to such books, people have posted such writing on the internet and they are freely available. However to find and read them one has to not spend all one's time in internet forums. If you really are interested in reading what is known in the industry about multi-threading, load and scaling, I strongly suggest you stop typing questions into internet forums and start using Google to find what known leaders in the industry have to say about the subject.
The truth is out there
led mike
|
|
|
|
|
Thanks led mike,
Please trust me I understand multi-threading, and also IOCP concept.
It is appreciated if you could recommend some good tutorials or books for me to read -- not about multi-threading, but the issue I described in this question about data access pattern issues. Any suggestions?
regards,
George
|
|
|
|
|
George_George wrote: Please trust me I understand multi-threading, and also IOCP concept.
That's not going to happen.
led mike
|
|
|
|
|
Hi led mike,
You mean what is not going to happen? Any issues with IOCP or?
regards,
George
|
|
|
|
|
George_George wrote: You mean what is not going to happen?
I am not about to believe you understand those things, and as my post in the other thread states, I believe you are being deliberately obtuse. I'm not impressed.
led mike
|
|
|
|
|
Hi led mike,
I am sorry for any inconvenience before -- everyone improves skills from time to time. My question is do you have any related materials to recommend?
regards,
George
|
|
|
|
|
George_George wrote: do you have any related materials to recommend?
Advanced Windows[^] if you think you are ready for advanced subjects. Based on your posting history you are not read, and likely never will be, but go ahead and take it for a spin if you like.
led mike
|
|
|
|
|
Hi led mike,
It is a good book about Windows internals. But what I am asking is the best practices for data access patterns, do you have related books to refer?
have a good weekend,
George
|
|
|
|
|
George_George wrote: But what I am asking is the best practices for data access patterns
Now that is just a bald faced lie!
Your original post (below) is clearly asking about multi-threading issues. The chapters in Richters book covering threading and threading issues is the best material I have ever read on threading. Read it or don't, it's up to you but I am done playing your stupid game of changing topics in the middle of a conversation. I don't know who the hell you are or why you enjoy playing these stupid games. Maybe you should try to get a girl friend.
George_George wrote: - I want to let client side library to start multiple threads to work efficiently to request for multiple content at the same time other than a single thread pattern;
- But I do not want to hit the server too hard and I also do not want to the library to consume too much resources (memory/threads) on client side to block other work of the client. The library is delivered as a DLL, so loaded into client side process, and will compete for resources of the same process.
Are there any good design patterns for such issues?
led mike
|
|
|
|
|
Thanks for your advice, led mike!
I am sorry for inconvenience.
regards,
George
|
|
|
|