<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9533623</id><updated>2012-01-22T14:22:14.060-08:00</updated><title type='text'>Esdee</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9533623.post-2009345611532963614</id><published>2011-09-25T13:27:00.000-07:00</published><updated>2011-09-25T13:44:17.886-07:00</updated><title type='text'>linux threads and forking (and zeroc ice)</title><content type='html'>so we have this nice icegrid setup with python nodes tied with sip to underlying c++ code. on new rpc call, ice creates a new thread to handle it, but as the underlying c++ code is not threadsafe we fork from this thread and continue execution in a new process.&lt;br /&gt;&lt;br /&gt;everything works perfectly, but one day we decide to remove the python layer and go with c++ all the way&lt;br /&gt;&lt;br /&gt;and then something weird started happening - forked processes started hanging, crashing, a total mess...after some research we found out several articles mentioning that it is a bad idea to mix linux threads and forks because of possible copied locked mutexes in the child process and this is exactly what we had observed.&lt;br /&gt;&lt;br /&gt;so how we solve this? and why the python+cpp solution worked fine?&lt;br /&gt;&lt;br /&gt;as a second solution we modified our code to use a thin python wrapper again over the main c++ functionality in attempt to copy the behavior from the original solution, but again the forked child processes had copied locked mutexes that caused them to hang&lt;br /&gt;&lt;br /&gt;so, how come? in the original solution A the underlying code is pretty much the same as B and C, what appears is that some ice threads are calling localtime_r in the moment when we fork and when the forked code tries to execure localtime_r it locks.&lt;br /&gt;but why does it not happen in the original python/cpp solution? why does it happen in the new python/cpp solution? are there some python flags to help avoid this? the original code would spend some time jumping from python to cpp, while the new code would only enter cpp code once and return the results.&lt;br /&gt;&lt;br /&gt;in any case it seems a mess so we went for another completely different solution, but the headache was/is huge&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-2009345611532963614?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/2009345611532963614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=2009345611532963614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2009345611532963614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2009345611532963614'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2011/09/linux-threads-and-forking-and-zeroc-ice.html' title='linux threads and forking (and zeroc ice)'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-4827830672138930957</id><published>2011-06-21T15:32:00.001-07:00</published><updated>2011-06-21T15:45:22.856-07:00</updated><title type='text'>c++: references vs. pointers</title><content type='html'>there is some campaign at my company right now. its about replacing/using references in new code as opposed to pointers because this is ....modern; right.&lt;br /&gt;&lt;br /&gt;i mean, i understand all the benefits of using shared pointers, smart pointers, boost utils, but please do not do it on mandatory basis; don't insist it is applied in every case and in every line of code, using references in the hands of an inexperienced programmer can raise even bigger problems than a bare naked 'C' pointer memory leak or such.&lt;br /&gt;&lt;br /&gt;two very common bugs i've encountered after reviewing some code that followed the new 'guidelines':&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;A&amp; func1()&lt;br /&gt;{&lt;br /&gt;A* a = new A;&lt;br /&gt;return *a;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;don't you think this is ugly in the least? not to mention, that nobody knows where 'a' is dealocated, if ever&lt;br /&gt;&lt;br /&gt;another example (this one is sweet as honey):&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;B&amp; func2(const B&amp; bIn)&lt;br /&gt;{&lt;br /&gt;B b = bIn;&lt;br /&gt;return b;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;it took me quite a few moments actually to realize that this method is returning a reference to a local object. no wonder then that the all of the sudden the returned object behaved strangely and had inconsistent data, as the author developer complained&lt;br /&gt;&lt;br /&gt;fun, fun, fun...&lt;br /&gt;&lt;br /&gt;anyway...all is good, references are fine and useful, but please don't say that using pointers is old fashioned, don't want to get started again...&lt;br /&gt;&lt;br /&gt;:D&lt;br /&gt;&lt;br /&gt;good night!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-4827830672138930957?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/4827830672138930957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=4827830672138930957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4827830672138930957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4827830672138930957'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2011/06/c-references-vs-pointers.html' title='c++: references vs. pointers'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-7865626413962181352</id><published>2011-04-30T13:02:00.000-07:00</published><updated>2011-04-30T13:39:30.752-07:00</updated><title type='text'>using apache qpid with persistence</title><content type='html'>that's just a quick post about two weeks struggle with a problem which was eventually solved in half an hour.&lt;br /&gt;&lt;br /&gt;as at my company we (i) decided to use apache QPID as a message queue framework, we certainly needed to use persistance for a queues and messages. building qpid itself was really easy and straight forward, and for building the persistance module msgstore.so i was following the directions posted at Lahiru Gunathilake's Blog &lt;a href="http://www.lahiru.org/2011/01/installing-apache-qpid-with-persistency.html"&gt;here&lt;/a&gt;. i build the whole setup on my local machine and everything was working just perfectly - messages were sent persitently, queues were durable etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;then i started deploying on the dev servers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the qpid broker started crashing on startup.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;the qpid broker started crashing on startup.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;the qpid broker started crashing on startup.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and on and on and on&lt;br /&gt;&lt;br /&gt;it was easy to detect that the problem appeared when the broker was started with --load-module=msgstore.so and that it seg faulted when attempting to create a berkeley db database. but why??&lt;br /&gt;well...on my local machine i am running fedora, and the dev server rules with CentOs.&lt;br /&gt;my fedora has berkeley db 4.8 and the server has 4.5. this was the first 'ding'.&lt;br /&gt;&lt;br /&gt;now, how to trick the qpid configure into using db4.8 instead of db4.5? we couldn't just install the new libs as there might have been incompatibilities with the product, so what to do? we tried modifying configure scripts, playing with sym links etc - i myself don't have much experience with linux so was relying mostly on the admin guy, but he was helpless with this too - seg fault after segfaul, while on my machine the broker hummed silently, transfering persistant messages and maintaining durable queues.&lt;br /&gt;&lt;br /&gt;then after a loooot of reading we came to an obvious solution - the qpid configure itself gave it too us, and hadn't i been too shortsighted, this would have been done days ago - &lt;br /&gt;&lt;br /&gt;just build berkeley 4.8 with --perfix to place it in a separate directory (say $BDB48), away from the db4.5 libs the product needs, and then, before running qpid configure, run these&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;export CPP_PATH=$BDB48/include&lt;br /&gt;export LIB_PATH=$BDB48/libs&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;(i'm writing these by memory, check qpid's configure script with --help to see the correct ones)&lt;br /&gt;&lt;br /&gt;after that run configure and it will find and use the berkeley libs you wanted it too!&lt;br /&gt;&lt;br /&gt;awesome!&lt;br /&gt;now lets do the same in production where we have RedHad 5. &lt;span style="font-weight:bold;"&gt;BOOM!&lt;/span&gt; here goes the so familiar seg fault that we managed to escape by the clever export trick. why? what is so different on redhat???&lt;br /&gt;another week of research, testing, breaking, hair-tearing followed, this time with no result.&lt;br /&gt;i was even contemplating to run a virtual fedora machine on the redhat server, just and so to have the familiar setup and start the broker with persitancy there.&lt;br /&gt;&lt;br /&gt;luckily i didn't have to -&lt;br /&gt;one day i sat with the it manager to explain him the situation and while we were scratching our heads we looked at persistance module's readme.txt where it said that it was tested with berkeley db 4.3.&lt;br /&gt;so what? we have db4.8 and it should be fine, right?&lt;br /&gt;what if we gave it another try, but not with the 4.8, but 4.3 set-up the same way?&lt;br /&gt;this took about10 minutes to setup and when i hit 'enter' for qpidd --load-module=msgstore.so, before my eyes was the beautiful log dump, saying that the module was loaded and so on and so on ....&lt;br /&gt;&lt;br /&gt;aaah....rtfm? the thing is we actually tested db4.3 when facing the initial problem of setting up the dev servers. this failed somehow, and so we didn't consider this when fighting with production setup&lt;br /&gt;&lt;br /&gt;anyways - this post grew as long as the first two episodes of "game of thrones" that i watched today :D&lt;br /&gt;&lt;br /&gt;have a good night and don't give up the fight!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-7865626413962181352?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/7865626413962181352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=7865626413962181352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/7865626413962181352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/7865626413962181352'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2011/04/using-apache-qpid-with-persistence.html' title='using apache qpid with persistence'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-4958690455136417462</id><published>2011-04-30T12:42:00.000-07:00</published><updated>2011-04-30T13:01:43.537-07:00</updated><title type='text'>giving back</title><content type='html'>i haven't been posting new articles, and even logging-in to this blog for probably years, but today i sat with the idea to share some more recent experience and noticed there were comments and "thanks", waiting to be approved (some sitting in for more than a year)...useless to say it warmed my heart that something i posted with the idea to be a dev diary read only by my self, actually turned out to be helpful for someone else out there, and that i incidentally have been giving my share to the greatest invention of our era - the Internet, the social network, the virtual community of knowledge and common interests, &lt;span style="font-weight:bold;"&gt;"The Void Which Binds"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;alright now - on to the next problem :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-4958690455136417462?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/4958690455136417462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=4958690455136417462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4958690455136417462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4958690455136417462'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2011/04/giving-back.html' title='giving back'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-2101141651120052650</id><published>2009-10-30T17:16:00.000-07:00</published><updated>2009-10-30T17:33:25.991-07:00</updated><title type='text'>OSSP mm - Shared Memory Allocation</title><content type='html'>i played a few days with the mm shared memory lib. i must say i liked it!&lt;br /&gt;it is easy to understand and easy to implement into existing code.&lt;br /&gt;of course the lack of new()/delete() is somewhat limiting, but not that difficult to overcome in most cases.&lt;br /&gt;alternatively, on our project we were looking into boost:interprocess, but i was kinda reluctant to use it, mostly because of the syntax (btw i found a boost/ace alternative at &lt;a href="http://pocoproject.org/documentation/"&gt;POCO&lt;/a&gt;, the users and designers say it provides boost/ace-a-like functionality, even if it cannot compare in perfomance, but the best gain is the C#-oriented syntax; probably worth it to examine).&lt;br /&gt;&lt;br /&gt;there was one really weird problem with mm though, when i got the impression that mm_lock() wasnt working.&lt;br /&gt;the workflow was a follows:&lt;br /&gt;we have a hash located on the shared memory segment and before i get() from it i mm_lock it and subsequently mm_unlock() it. still i noticed that many times same value was being written to the hash, which was unexpected by design.&lt;br /&gt;i fired our test up to create a few working processes and breaked in each one before a get(). the locks seemed to work, but after a put() suddenly the lock seemed to vanish in the haze?! digging deeper i found out that in put() we of course try to allocad some new memory in the shared mem segment and traceing down into mm_malloc i found out it was trying to lock too, and when done - calling mm_unlock()! piece of bad design or weird side-effect? either way, apart from that my impressions with OSSP mm were great. however it turned out that the boost guys go a few more tricks up in their sleeves, especially the name persisted storage seemed a very attractive idea for our purposes and we eventually decided to use the boost approach.&lt;br /&gt;so...moving on and up again :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-2101141651120052650?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/2101141651120052650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=2101141651120052650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2101141651120052650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2101141651120052650'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2009/10/ossp-mm-shared-memory-allocation.html' title='OSSP mm - Shared Memory Allocation'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-2322983817858680077</id><published>2009-10-19T12:08:00.000-07:00</published><updated>2009-10-19T12:23:51.172-07:00</updated><title type='text'>random performace thoughts</title><content type='html'>just wanted to lay things out so i can see them more clearly. if it doesn't make sense to you, dear readers, please excuse me :) &lt;br /&gt;&lt;br /&gt;so, we have many hashes (maps, containing cached data), but due to our implementation with fork() all the data is lost once a particular task is done. i had the idea of storing all those in a berkeley db so that every new forked task gets it from there and doesn't have to fill the hash by itself, but then - what is a task gonna read from the db when it doesn't know what it is gonna need beforehand. we cannot read everything as the data is HUGE and we cant read bit by bit as this slows down performance a lot - we had a test case like this: we tried using memcached as a remote cache, but this slowed us down even if we read from it only once into a local hash and all next calls where local (quick); if we hadn't read into local hash first, the slowdown would be even more devastating.&lt;br /&gt;&lt;br /&gt;one possible solution is for the main process to reread all from the stored data and all children would get it via fork/copy-on-write and then put any changes/additions back into the db for the parent to read when a new task requests start.&lt;br /&gt;&lt;br /&gt;i have another one around - when if we realise what we need from the cache much earlier than when we need it? we could then start a thread to pre-load the expected data while the main thread goes on processing and when it reached the point when the hash is needed - voila! its all up there! in case there are gaps they can be filled runtime, should be a small percentage of the overall effort&lt;br /&gt;&lt;br /&gt;i'm working on a shared memory solution, but all these got me into doubt about the performance hit, similar to hitting the memcached everytime (by the way, i found out about &lt;a href="http://www.ossp.org/pkg/lib/mm/"&gt;OSSP mm&lt;/a&gt; shared memory allocation project at http://www.ossp.org/pkg/lib/mm/, and it looks really good. i dont know how i missed it earlier, guess i was looking for a std-kind-of allocator and got ptu back by some messages that boost had given up on the idea. another btw - is the new std with C++x0 gonna include something like this? from what i read it does include some fancy new stuff related to multithreaded and multicore programming which is awesome. would be great once we get our hands on it)&lt;br /&gt;&lt;br /&gt;so where was i....aaah...back to the drawing board, time for another brainstoriming session...tomorrow :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-2322983817858680077?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/2322983817858680077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=2322983817858680077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2322983817858680077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2322983817858680077'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2009/10/random-performace-thoughts.html' title='random performace thoughts'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-5660465373410330707</id><published>2009-02-11T16:05:00.000-08:00</published><updated>2009-02-11T16:48:14.903-08:00</updated><title type='text'>More on Berkeley DB</title><content type='html'>alright! time passes on and one gets wiser (or feels sillier and has more questions to ask).&lt;br /&gt;&lt;br /&gt;the project i'm working on is written in python with c++ interop throught sip.&lt;br /&gt;at one point we had to move from the solely single-threaded design (who would design a single-threaded SERVER may i ask, duh) to a scalable architecture.&lt;br /&gt;&lt;br /&gt;the first obstacle we hit was the mighty GIL of Python (oh my, what didn't i try to overcome this...) - fighting this monster made me an expert in providing solutions for scalability and performance optimizations. or not.&lt;br /&gt;&lt;br /&gt;anyway, one of the problems we had was that somehow the data we read from berkeley db would become corrupted seemingly without any reason. dude...what a mess. our system is complicated enough so it took some time till we came to investigate the possibility that bdb was somehow the reason for this. &lt;br /&gt;i studied the solutions for multithreaded and multiprocess access to bdb, added DbEnv, also played a bit with DB_DBT_USERMEM because we thought that simply relying on &lt;a href="http://www.oracle.com/technology/documentation/berkeley-db/xml/api_cxx/dbt_class.html"&gt;DB_DBT_MALLOC&lt;/a&gt; might lead to mem leaks (i still have to thouringly test and make sure that &lt;i&gt;&lt;u&gt;this&lt;/u&gt;&lt;/i&gt; is not an issue).&lt;br /&gt;eventually we came to this - whenever you fork and the parent and any children processes share bdb handles - &lt;b&gt;CLOSE AND REOPEN THE DB HANDLES IN THE CHILD PROCESS!&lt;/b&gt;&lt;br /&gt;this can save you a couple of hours (or weeks) of hitting your head against the wall, so do this, get your bonus and go happilly home to your family for the day&lt;br /&gt;&lt;br /&gt;cheers&lt;br /&gt;&lt;br /&gt;to be continued...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-5660465373410330707?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/5660465373410330707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=5660465373410330707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/5660465373410330707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/5660465373410330707'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2009/02/more-on-berkeley-db.html' title='More on Berkeley DB'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-3231000741661817482</id><published>2008-11-11T13:54:00.000-08:00</published><updated>2008-11-11T15:07:59.685-08:00</updated><title type='text'>getting to know Berkeley DB</title><content type='html'>getting to know Berkeley DB came upon this link:&lt;br /&gt;&lt;a href="http://simonwillison.net/2003/Nov/26/discoveringBerkeleyDB"&gt;&lt;br /&gt;http://simonwillison.net/2003/Nov/26/discoveringBerkeleyDB/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and this comment:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;My only complaint about BerkeleyDB is that it's a wee bit flaky when not used with transactions. Databases can become corrupted, processes can deadlock, etc. I've found problems even when using CDS mode. Only problem with wrapping everything in transactions is the performance hit. So, here's what we came up with as a compromise (we use the excellent BerkeleyDB.pm module from our Perl code): lock the entire database on write with a semaphore. The overhead is negligible in terms of speed, but it's done a remarkable job of keeping our indexes very clean!&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;lock the entire database on write with a semaphore&lt;/b&gt;&lt;br /&gt;???&lt;br /&gt;say again?&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Update (a few hours later)&lt;/u&gt;&lt;br /&gt;i'm beginning to understand what the comment author meant....my rdbms experiece will freak out with these new ideas in berkeley db...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-3231000741661817482?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/3231000741661817482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=3231000741661817482' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3231000741661817482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3231000741661817482'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/11/getting-to-know-berkeley-db.html' title='getting to know Berkeley DB'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-4381771402128728380</id><published>2008-10-17T12:13:00.000-07:00</published><updated>2008-10-17T12:16:40.618-07:00</updated><title type='text'>rpmdb: PANIC: fatal region error detected; run recovery</title><content type='html'>i started playing with &lt;a href="fedora.org"&gt;fedora&lt;/a&gt; linux and today got this error while unstalling a package...&lt;br /&gt;&lt;font color="red"&gt;rpmdb: PANIC: fatal region error detected; run recovery&lt;/font&gt;&lt;br /&gt;or actually many of these msgs&lt;br /&gt;&lt;br /&gt;so this one helped to quickly resolve this&lt;br /&gt;&lt;a href="http://www.redhat.com/archives/fedora-list/2006-October/msg03072.html"&gt;&lt;br /&gt;http://www.redhat.com/archives/fedora-list/2006-October/msg03072.html&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-4381771402128728380?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/4381771402128728380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=4381771402128728380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4381771402128728380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4381771402128728380'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/10/rpmdb-panic-fatal-region-error-detected.html' title='rpmdb: PANIC: fatal region error detected; run recovery'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-1464028996828408922</id><published>2008-09-17T13:43:00.000-07:00</published><updated>2008-09-17T13:48:08.425-07:00</updated><title type='text'>wireless configuration: Incorrect MFC DLL version installed</title><content type='html'>several hours came and went banging my head against the wall after getting this error msg.&lt;br /&gt;all started when i decided to finally uninstall vs 2003 and i guess it removed some dlls that i shouldn't have to...&lt;br /&gt;i'm fairly pissed off right now so lets skip to the solution:&lt;br /&gt;after deciding not reinstall windows because of this, at least i decided to put xp sp3, although i didn't really needed to...anyway this didn't help =/&lt;br /&gt;after absurdly many hours of google search i came to this page - &lt;a href="http://www.techsupportforum.com/microsoft-support/windows-xp-support/169616-incorrect-mfc-dll-version-installed-system.html"&gt;http://www.techsupportforum.com/microsoft-support/windows-xp-support/169616-incorrect-mfc-dll-version-installed-system.html&lt;/a&gt;&lt;br /&gt;and this hint led me to open my services tab, kill the fukking 'tray service' and write this blog, quite sardonically if i may add...&lt;br /&gt;damn software :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-1464028996828408922?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/1464028996828408922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=1464028996828408922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/1464028996828408922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/1464028996828408922'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/09/wireless-configuration-incorrect-mfc.html' title='wireless configuration: Incorrect MFC DLL version installed'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-6494744615803234873</id><published>2008-09-15T07:46:00.000-07:00</published><updated>2008-09-15T07:57:14.252-07:00</updated><title type='text'>on the market</title><content type='html'>ok, so first interview came and went - what conclusions can be made?&lt;br /&gt;the interviewer asked me about &lt;b&gt;&lt;u&gt;App domains&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;I was never really interested in those, said one of the benefits is the version control, gotta check this.&lt;br /&gt;On &lt;b&gt;&lt;u&gt;multithreading&lt;/u&gt;&lt;/b&gt;...should i read more about some test cases? i spoke of some of my experience with it, its funny that when you have to talk about it its sometimes hard to elaborate on the subject...&lt;br /&gt;&lt;b&gt;&lt;u&gt;WCF&lt;/u&gt;&lt;/b&gt;, now thats a weak point - i have experience with &lt;b&gt;&lt;u&gt;.Net remoting&lt;/u&gt;&lt;/b&gt;, but so many years ago I could hardly say any details, but it felt bad when the guy asked me had I had even read about WCF and I said "err...no" - gotta take care of this too, i guess&lt;br /&gt;he also asked me if i had any experience with &lt;b&gt;&lt;u&gt;MS SQL Server&lt;/u&gt;&lt;/b&gt;, but when i started talking and mentioned the two certifications i have in this he seemed satisfied enough.&lt;br /&gt;hmm...what else was there...&lt;br /&gt;&lt;br /&gt;oh but of course - &lt;b&gt;&lt;u&gt;Web services&lt;/u&gt;&lt;/b&gt; - the last positions had me implementing solutions reading/writing from Web services, and this was good as when he asked me about securing web services i was stuck until i remembered how one of the service providers worked - by supplying a cookie to be used in each request after the initial login/pwd shakeup&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-6494744615803234873?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/6494744615803234873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=6494744615803234873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/6494744615803234873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/6494744615803234873'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/09/on-market.html' title='on the market'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-3615756349627485387</id><published>2008-08-05T07:58:00.000-07:00</published><updated>2008-08-05T08:21:43.125-07:00</updated><title type='text'>Class member Entity.Id is unmapped.</title><content type='html'>ok, the problem come from the fact that we have a number of tables (linq entities), but only a few of them have the Id column, and only on those few i need to run a certain method.&lt;br /&gt;so how to do this?&lt;br /&gt;&lt;br /&gt;i created the generic method&lt;br /&gt;&lt;p&gt;&lt;br /&gt;MMethod&lt;T&gt;(int id) where T : Entity, IEntity&lt;br /&gt;{&lt;br /&gt;        var r = from s in source.GetEntity&lt;T&gt;()&lt;br /&gt;                      where s.Id == id&lt;br /&gt;                      select s;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;and here i started getting the errors...&lt;br /&gt;first of course i could not use s.Id because the general T doesn't have Id member defined.&lt;br /&gt;so i started looking where to define it - and first defined it in the interface.&lt;br /&gt;now, the interface would have the property Id and some of the linq entities would also have it, but on evaluation of the var r i would get&lt;br /&gt;&lt;b&gt;&lt;br /&gt;The mapping of interface member [...] is not supported&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;nice...&lt;br /&gt;some reading on google and i started looking for another place to add this member.&lt;br /&gt;the other obvious choice - the entity class.&lt;br /&gt;this seemed to be my last chance, after i tried coming up with an extension method or whatever desperate solution i could think of.&lt;br /&gt;&lt;br /&gt;so, member added, all compiled nicely, but while in debug i decided to see what the var r evaluates to and saw a sweet message:&lt;br /&gt;&lt;font color="red"&gt;&lt;br /&gt;Class member Id is unmapped&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;so...WTF? Id is now nicely defined and visible everywhere, so how come this error? and what does it mean??&lt;br /&gt;&lt;br /&gt;some browsing in google, and i come to this page&lt;br /&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2446465&amp;SiteID=1"&gt;&lt;br /&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2446465&amp;SiteID=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;at first quick look i couldn't find any solution, but, ooo how nice that i didn't close the page immediately, because after some time i went back to it, as something stuck as a neat idea - the guy was talking about a possible bug in linq implementation, but gave a few examples of when a statement worked and when it didn't, so i decided to give a try to one of the statements that he claimed to have worked and....&lt;font color="blue"&gt;voila!&lt;/font&gt;&lt;br /&gt;problem resolved.&lt;br /&gt;while waiting for the build i came upon another page that confirmed this solution here: &lt;a href="http://stuff.hornbostel.com/?cat=10"&gt;http://stuff.hornbostel.com/?cat=10&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;neat&lt;br /&gt;thanks guys&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-3615756349627485387?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/3615756349627485387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=3615756349627485387' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3615756349627485387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3615756349627485387'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/08/class-member-entityid-is-unmapped.html' title='Class member Entity.Id is unmapped.'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-3897068787904476406</id><published>2008-07-29T07:29:00.000-07:00</published><updated>2008-07-29T07:36:29.603-07:00</updated><title type='text'>xlLocalSessionChanges not working</title><content type='html'>"xlLocalSessionChanges not working"&lt;br /&gt;&lt;br /&gt;this is the conclusion i reached when i passed XlSaveConflictResolution.xlLocalSessionChanges to workbook.SaveAs and the maddening alert showed up again.&lt;br /&gt;before that i wasted a few hours wondering why my server application seemed to hang at the step when it should be writing some data to excel/csv file.&lt;br /&gt;i was watching the results remotely through rdp and only later it occured to me that while i was waiting, on the server an alert appeared requiring user input - simple Yes/No/Cancel which I wasn't able to see through my remote session....&lt;br /&gt;&lt;br /&gt;now this - setting the value to always overwrite the file and still this alertbox?&lt;br /&gt;&lt;br /&gt;good think i quickly came upon &lt;a href="http://www.notes411.com/dominosource/tips.nsf/0/B4EC9AD3C6CC8398802571790046F9DB!opendocument"&gt;this&lt;/a&gt; page:&lt;br /&gt;&lt;a href="http://www.notes411.com/dominosource/tips.nsf/0/B4EC9AD3C6CC8398802571790046F9DB!opendocument"&gt;&lt;br /&gt;http://www.notes411.com/dominosource/tips.nsf/0/B4EC9AD3C6CC8398802571790046F9DB!opendocument&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;turns out the ExcelApplication has a property that has to be set as well so this all works...cracks....&lt;i&gt;&lt;b&gt;excel.DisplayAlerts = false&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Thanks, Mr. SCRobinson that tip had been very helpful...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-3897068787904476406?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/3897068787904476406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=3897068787904476406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3897068787904476406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3897068787904476406'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/07/xllocalsessionchanges-not-working.html' title='xlLocalSessionChanges not working'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-3703917620195954770</id><published>2008-07-25T13:00:00.000-07:00</published><updated>2008-07-25T13:33:54.154-07:00</updated><title type='text'>The request was aborted: A connection that was expected to be kept alive was closed by the server</title><content type='html'>it all started with this&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The operation has timed out&lt;br /&gt;   at System.Net.HttpWebRequest.GetRequestStream()&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;first i thought this might be because of firewall, proxy, something local for our network...then we turned our attention to the counterparty - they chased their logs and  couldn't find anything related to timeouts or connection drops for our endpoints...&lt;br /&gt;then crazy testing began - the crazy thing was that all seemed to work on the local machined and in production, then it stopped working in production, and later it stopped working in dev also...nothing miraculous here - turned our we tested wrongly in dev, so all failed everywhere.&lt;br /&gt;this code is a part of a nightly process so it quickly became a pain to wait and see if the nightly process worked and if not (most of the times) run the processes manually..pain pain pain...&lt;br /&gt;&lt;br /&gt;so before this weekend i finally sat and decided to dedicate all my time to solving this fundamental problem&lt;br /&gt;&lt;br /&gt;i had already set KeepAlive to false and this 'seemed' to work for some time...before coming back with fierce force&lt;br /&gt;&lt;br /&gt;so the long chase on the net began...&lt;br /&gt;&lt;br /&gt;the first step in the correct direction was to add .Net network tracing to the app, through this app.config setting:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;p&gt;&lt;br /&gt;        &amp;lt;system.diagnostics&amp;gt;&lt;br /&gt;        &amp;lt;sources&amp;gt;&lt;br /&gt;            &amp;lt;source name="System.Net" tracemode="includehex" maxdatasize="1024"&amp;gt;&lt;br /&gt;                &amp;lt;listeners&amp;gt;&lt;br /&gt;                    &amp;lt;add name="System.Net"/&amp;gt;&lt;br /&gt;                &amp;lt;/listeners&amp;gt;&lt;br /&gt;            &amp;lt;/source&amp;gt;&lt;br /&gt;            &amp;lt;source name="System.Net.Sockets"&amp;gt;&lt;br /&gt;                &amp;lt;listeners&amp;gt;&lt;br /&gt;                    &amp;lt;add name="System.Net"/&amp;gt;&lt;br /&gt;                &amp;lt;/listeners&amp;gt;&lt;br /&gt;            &amp;lt;/source&amp;gt;&lt;br /&gt;            &amp;lt;source name="System.Net.Cache"&amp;gt;&lt;br /&gt;                &amp;lt;listeners&amp;gt;&lt;br /&gt;                    &amp;lt;add name="System.Net"/&amp;gt;&lt;br /&gt;                &amp;lt;/listeners&amp;gt;&lt;br /&gt;            &amp;lt;/source&amp;gt;&lt;br /&gt;        &amp;lt;/sources&amp;gt;&lt;br /&gt;        &amp;lt;switches&amp;gt;&lt;br /&gt;            &amp;lt;add name="System.Net" value="Verbose"/&amp;gt;&lt;br /&gt;            &amp;lt;add name="System.Net.Sockets" value="Verbose"/&amp;gt;&lt;br /&gt;            &amp;lt;add name="System.Net.Cache" value="Verbose"/&amp;gt;&lt;br /&gt;        &amp;lt;/switches&amp;gt;&lt;br /&gt;        &amp;lt;sharedListeners&amp;gt;&lt;br /&gt;            &amp;lt;add name="System.Net"&lt;br /&gt;              type="System.Diagnostics.TextWriterTraceListener"&lt;br /&gt;              initializeData="network.log"/&amp;gt;&lt;br /&gt;        &amp;lt;/sharedListeners&amp;gt;&lt;br /&gt;        &amp;lt;trace autoflush="true" indentsize="4"&amp;gt;&lt;br /&gt;            &amp;lt;listeners&amp;gt;&lt;br /&gt;                &amp;lt;add name="file" type="System.Diagnostics.TextWriterTraceListener" initializeData="networktrace.log"/&amp;gt;&lt;br /&gt;            &amp;lt;/listeners&amp;gt;&lt;br /&gt;        &amp;lt;/trace&amp;gt;  &lt;br /&gt;    &amp;lt;/system.diagnostics&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;this pinpointed the problem and helped develop a reproduce-case: the time-out reoccured every third time HttpWebRequest.GetRequestStream() was called - awesome, so now what?&lt;br /&gt;&lt;br /&gt;well the trace at least gave me hints no to what too look for in google - the timeout occured after these lines&lt;br /&gt;&lt;br /&gt;System.Net Information: 0 : [1696] Associating HttpWebRequest#38557668 with ServicePoint#62013521&lt;br /&gt;System.Net Information: 0 : [1696] Associating Connection#12798926 with HttpWebRequest#38557668&lt;br /&gt;&lt;br /&gt;which meant, there was a problem creating the socket?&lt;br /&gt;whatever - the case continued...&lt;br /&gt;&lt;br /&gt;many people were experiencing thi serror:&lt;br /&gt;&lt;i&gt;The underlying connection was closed: A connection that was expected to be kept alive was closed by the server&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and offered as solution setting keepalive=false, which i already had in place.&lt;br /&gt;there was also a link here: &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;915599"&gt;&lt;br /&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;915599&lt;/a&gt;&lt;br /&gt;which gave another hint:&lt;br /&gt;playing with &lt;b&gt;ServicePointManager.MaxServicePointIdleTime&lt;/b&gt; property&lt;br /&gt;&lt;br /&gt;there was also a hint to set&lt;br /&gt;&lt;i&gt;webRequest.ProtocolVersion=HttpVersion.Version10&lt;/i&gt;&lt;br /&gt;which i don't to play with right now&lt;br /&gt;&lt;br /&gt;the last and seemingly, best solution was given by &lt;a href="http://markitup.com/"&gt;Darren Neimke&lt;/a&gt; &lt;a href="http://markitup.com/Posts/Post.aspx?postId=c98db0ca-f3a8-4f49-bb96-641574274c1a"&gt;&lt;br /&gt;http://markitup.com/Posts/Post.aspx?postId=c98db0ca-f3a8-4f49-bb96-641574274c1a&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;p&gt;&lt;br /&gt;WebRequest req = HttpWebRequest.Create("http://foo");&lt;br /&gt;req.ConnectionGroupName = Guid.NewGuid().ToString();&lt;br /&gt;&lt;br /&gt;using (Stream stream = req.GetRequestStream()) {&lt;br /&gt;// do stuff here&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;a saw the &lt;b&gt;ConnectionGroupName&lt;/b&gt; approach also here:&lt;a href="http://blog.josh420.com/archives/2008/02/underlying-connection-closed-fix-pesky-aspnet-webexception.aspx"&gt;&lt;br /&gt;http://blog.josh420.com/archives/2008/02/underlying-connection-closed-fix-pesky-aspnet-webexception.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;still testing....will this help me not see this log below anymore?&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;p&gt;&lt;br /&gt;System.Net Verbose: 0 : [3828] HttpWebRequest#48833621::Abort(The operation has timed out)&lt;br /&gt;System.Net.Sockets Verbose: 0 : [3828] Socket#3798230::Dispose()&lt;br /&gt;System.Net Error: 0 : [1696] Exception in the HttpWebRequest#38557668:: - The request was aborted: A connection that was expected to be kept alive was closed by the server.&lt;br /&gt;System.Net Verbose: 0 : [3828] Exiting HttpWebRequest#48833621::Abort() &lt;br /&gt;&lt;p&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-3703917620195954770?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/3703917620195954770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=3703917620195954770' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3703917620195954770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/3703917620195954770'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/07/request-was-aborted-connection-that-was.html' title='The request was aborted: A connection that was expected to be kept alive was closed by the server'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-8623053940176359374</id><published>2008-06-20T14:12:00.000-07:00</published><updated>2008-06-20T14:21:39.346-07:00</updated><title type='text'>Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005</title><content type='html'>&lt;font color="red"&gt; Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;seeing exceptions like this make me moan in desperation... spent several hours searching the web...and although i found few good articles on this error &lt;a href="http://blog.crowe.co.nz/archive/2006/03/02/589.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://www.computerperformance.co.uk/Logon/code/code_80070005.htm"&gt;here&lt;/a&gt;, I didn't exactly followed them because in our web app we have impersonating user, so when i opened Component Services-&gt;Computers-&gt;My Computer-&gt;DCOM Config and opened properties on Microsoft Excel Application and would give Launch permissions to this impersonated user.&lt;br /&gt;It didn't work the first time, not the second, so I added this user to the local admins group.&lt;br /&gt;This didn't work much either.&lt;br /&gt;So in the end in some post a line containing 'Event Log' caught my attention and I swiftly opened the event viewer where, under System, found several relevant error messages, one of which &lt;br /&gt;&lt;font color="#ff2299"&gt;&lt;br /&gt;The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID... &lt;br /&gt;&lt;/font&gt; gave me the info I needed - turns out I really had to put the ASPNET user account under which asp.net is running.&lt;br /&gt;&lt;br /&gt;This solved the problem&lt;br /&gt;&lt;br /&gt;I still have doubts as to why the ASPNET account should be held responsible and not the impersonated one, but....&lt;b&gt;whatever!&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-8623053940176359374?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/8623053940176359374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=8623053940176359374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/8623053940176359374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/8623053940176359374'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/06/retrieving-com-class-factory-for.html' title='Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-5107161759260196762</id><published>2008-06-19T07:49:00.001-07:00</published><updated>2008-06-19T07:53:09.408-07:00</updated><title type='text'>MS SQL Server Management Studio - Create new table/Add new column</title><content type='html'>For some (long) time now I've been irritated by SQL Server Management Studio everytime I add new column to a table that has to be var char with length other than 50, which is the default.&lt;br /&gt;It was like whenever I put value different than 50, Management Studio would revert the value back to 50, and I'd have to change the value again and this time it would work.&lt;br /&gt;&lt;br /&gt;Now today I noticed something - this would happen everytime I put a value of varchar(10), but not for other values!&lt;br /&gt;So for varchar(10) it is reverted to varchar(50),&lt;br /&gt;but for varchar(20) the value is preserved when I change the focus....funny, no?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-5107161759260196762?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/5107161759260196762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=5107161759260196762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/5107161759260196762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/5107161759260196762'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/06/ms-sql-server-management-studio-create.html' title='MS SQL Server Management Studio - Create new table/Add new column'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-839348925778716151</id><published>2008-06-17T08:22:00.000-07:00</published><updated>2008-06-17T08:29:08.557-07:00</updated><title type='text'>Assembly.GetEntryAssembly()</title><content type='html'>I have to use a library designed for use with Winforms.&lt;br /&gt;I have to use it in Asp.net though, so at one point I got to a method using unguarded Assembly.GetEntryAssembly() call that failed.&lt;br /&gt;&lt;br /&gt;After a little research and found this in the MSDN:&lt;i&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;            The GetEntryAssembly method can return null reference (Nothing in Visual Basic) when a managed assembly has been loaded from an unmanaged application&lt;/p&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and became evident that the reason for the problem was that the library was call from the unmanaged IIS process.&lt;br /&gt;&lt;br /&gt;I searched for a generic solution, but finally only managed to find a &lt;u&gt;hint&lt;/u&gt; &lt;a href="http://www.developersdex.com/asp/message.asp?p=2912&amp;r=5817390"&gt;here:http://www.developersdex.com/asp/message.asp?p=2912&amp;r=5817390&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;so now I'll add this code to solve the problem&lt;br /&gt;&lt;i&gt;&lt;br /&gt;if (null != Assembly.GetEntryAssembly())&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// proceed with Assembly.GetEntryAssembly()&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Else&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// read a setting from the config file and set the entry assembly to this value if not empty&lt;br /&gt;&lt;br /&gt;System.Configuration.ConfigurationManager.AppSettings["EntryAssembly"]&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and thats all for now ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-839348925778716151?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/839348925778716151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=839348925778716151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/839348925778716151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/839348925778716151'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/06/assemblygetentryassembly.html' title='Assembly.GetEntryAssembly()'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-4742613957245514962</id><published>2008-05-19T15:36:00.001-07:00</published><updated>2008-05-19T16:15:54.770-07:00</updated><title type='text'>Linq OrderBy Descending fun</title><content type='html'>So for a few days I've been playing with Linq with production code and it looked great and (at least the usual stuff) pretty straightforward.&lt;br /&gt;The underlying c# is scary of course, reminding me of the nightmare from the C++ generics/COM days. But at least now the IDE has evolved and IntelliSense works nicely.&lt;br /&gt;&lt;br /&gt;Anyway - I came to the point were some tweaking was needed and some parametrizing - mainly i needed the order by to be runtime desided - 'dynamic' if you wish - so i started reading around blogs and sample code, but all seem to be aiming too high and I didn't have much time to &lt;u&gt;really&lt;/u&gt; dive into Linq (which I should do &lt;i&gt;someday&lt;/i&gt; anyway)... still quantity changes lead to some understanding of the problem in question , mostly after looking at (not really reading) samples at http://www.ddj.com/database/205604421, http://srtsolutions.com/blogs/billwagner/archive/2006/03/29/ordering-linq-results.aspx&lt;br /&gt;and http://community.bartdesmet.net/blogs/bart/archive/2008/04/27/q-is-iqueryable-the-right-choice-for-me.aspx&lt;br /&gt;&lt;br /&gt;I came up with this really small snippet of code that solved easily my problem&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;        public static OrderedEnumerableRowCollection&lt;TRow&gt;&lt;br /&gt;            OrderByEnhanced&lt;TRow, TKey&gt;&lt;br /&gt;                (this EnumerableRowCollection&lt;TRow&gt; source, Func&lt;TRow, TKey&gt; keySelector, bool ASC)&lt;br /&gt;        {&lt;br /&gt;            if (ASC)&lt;br /&gt;                return source.OrderBy(keySelector);&lt;br /&gt;            else&lt;br /&gt;                return source.OrderByDescending(keySelector);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;ain't it funny - it is so simple, but looking for a solution to my problem lead me to reading a lot about Linq and helped me learn a lot too, so that time was not waisted, so to say&lt;br /&gt;&lt;br /&gt;cha!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-4742613957245514962?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/4742613957245514962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=4742613957245514962' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4742613957245514962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4742613957245514962'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/05/linq-orderby-descending-fun.html' title='Linq OrderBy Descending fun'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-9079760390605766671</id><published>2008-04-16T12:07:00.001-07:00</published><updated>2008-04-17T13:44:01.659-07:00</updated><title type='text'>OUTPUT clause in INSERT/UPDATE/DELETE statements</title><content type='html'>just playing with the new (for sql server 2005 and for me) OUTPUT clause.&lt;br /&gt;I had some hopes for it but turns out i cant write something like&lt;br /&gt;&lt;p&gt;&lt;i&gt;&lt;font color="#338844"&gt;&lt;br /&gt;insert &lt;b&gt;targettable&lt;/b&gt; (col1,col2)&lt;br /&gt;output &lt;b&gt;Inserted&lt;/b&gt;.col1, &lt;b&gt;sourcetable&lt;/b&gt;.somecol&lt;br /&gt;select somecol1,somecol2 from &lt;b&gt;sourcetable&lt;/b&gt;&lt;br /&gt;&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;that is - i cant &lt;i&gt;output&lt;/i&gt; values from the &lt;b&gt;Inserted&lt;/b&gt; and also values from the &lt;b&gt;source&lt;/b&gt; table :( &lt;br /&gt;a bit disappointing in a way, of course, because i wanted to have backwards mapping between the source and inserted tables, but now I just decided to use one of the columns in the inserted table as this mapping ids placeholder&lt;br /&gt;&lt;br /&gt;voila...&lt;br /&gt;&lt;br /&gt;&lt;u&gt;EDIT:&lt;/u&gt;&lt;br /&gt;according to msdn article on T-SQL Delete&lt;br /&gt;it is possible to &lt;i&gt;OUTPUT&lt;/i&gt; exactly what I need...&lt;br /&gt;&lt;p&gt;&lt;br /&gt;DELETE Production.ProductProductPhoto&lt;br /&gt;OUTPUT DELETED.ProductID,&lt;br /&gt;       p.Name,&lt;br /&gt;       p.ProductModelID,&lt;br /&gt;       DELETED.ProductPhotoID&lt;br /&gt;    INTO @MyTableVar&lt;br /&gt;FROM Production.ProductProductPhoto AS ph&lt;br /&gt;JOIN Production.Product as p &lt;br /&gt;    ON ph.ProductID = p.ProductID &lt;br /&gt;    WHERE p.ProductModelID BETWEEN 120 and 130;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;strange...now I'll have to achieve the same results somehow...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-9079760390605766671?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/9079760390605766671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=9079760390605766671' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/9079760390605766671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/9079760390605766671'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/04/output-clause-in-insertupdatedelete.html' title='OUTPUT clause in INSERT/UPDATE/DELETE statements'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-198599355996885897</id><published>2008-04-11T12:07:00.000-07:00</published><updated>2008-04-11T12:12:44.388-07:00</updated><title type='text'>Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider 'SQLOLEDB' returned an unexpected data length for the fixed-length column</title><content type='html'>I got the error described here &lt;a href="http://support.microsoft.com/kb/920930"&gt;http://support.microsoft.com/kb/920930&lt;/a&gt;&lt;br /&gt;when running a test &lt;i&gt;select *&lt;/i&gt; from a view on a linked server&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;font color="#ff8844"&gt;&lt;br /&gt;Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider 'SQLOLEDB' returned an unexpected data length for the fixed-length column '[LinkedServerName].[DBName].[OwnerName].[TableOrViewName].ColumnName'. The expected data length is n, while the returned data length is m.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;when searching on google web/groups the compains were for sql server 2000 and below so not much help until i decided run the same query on the linked server itself and it went through without a problem.&lt;br /&gt;turned out the column in question (the one that reportedly returned larger data than expected) is empty.&lt;br /&gt;so i just rewrote the query to return only a subset of data i needed and all worked nicely&lt;br /&gt;&lt;br /&gt;so...fun...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-198599355996885897?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/198599355996885897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=198599355996885897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/198599355996885897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/198599355996885897'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/04/server-msg-7347-level-16-state-1-line-1.html' title='Server: Msg 7347, Level 16, State 1, Line 1 OLE DB provider &apos;SQLOLEDB&apos; returned an unexpected data length for the fixed-length column'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-4827364319464819809</id><published>2008-03-25T07:56:00.001-07:00</published><updated>2008-12-11T04:07:43.003-08:00</updated><title type='text'>/LM/W3SVC/1/ROOT/AppName is unavailable</title><content type='html'>So I created this neat c# web service and went to deploy it to our clustered environment.&lt;br /&gt;Before that I ran the web setup on a dev server and it installed flawlessly so what a big surprise it was that when i tried to install it in production I got this lovely message:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_o_uxRpS-GjI/R-kT47poKMI/AAAAAAAAAAU/aH2BUoUrJXw/s1600-h/lm_w3svc_root_unavailable.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_o_uxRpS-GjI/R-kT47poKMI/AAAAAAAAAAU/aH2BUoUrJXw/s400/lm_w3svc_root_unavailable.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5181694715072358594" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(it says: 'the specified path 'lm/w3svc/1/root/yourappname' is unavailable. the internet information server might not be running or the path exists and is redirected to another machine. please check the status of this virtual directory in the internet services manager')&lt;br /&gt;&lt;br /&gt;don't you love it when all is fine while you develop but when you &lt;i&gt;try&lt;/i&gt; to deploy something maddeningly breaks...&lt;br /&gt;&lt;br /&gt;Few hours of google search didn't bring any solutions, so i had to figure it out myself, being the genius IIS admin, that i am (not).&lt;br /&gt;first i thought this might be due to our production servers being in a cluster, (mis?)lead by the &lt;i&gt;'...is redirected to another machine'&lt;/i&gt; part of the message, but even taking one or the other of the servers off the cluster (temporarily) didn't help.&lt;br /&gt;after a few similar guess/error tries i simply created a folder in inetpub where my web service would be dwelling, created a virtual folder pointing to this empty folder, run the setup again and.....it didnt break this time(!) - simply copied the contents of the web service and off we went&lt;br /&gt;&lt;br /&gt;so i guess Okam's razor works...even for deploying c# web service solutions in IIS&lt;br /&gt;&lt;br /&gt;&lt;u&gt;lovely&lt;/u&gt; ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-4827364319464819809?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/4827364319464819809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=4827364319464819809' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4827364319464819809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/4827364319464819809'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/03/lmw3svc1rootappname-is-unavailable.html' title='/LM/W3SVC/1/ROOT/AppName is unavailable'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o_uxRpS-GjI/R-kT47poKMI/AAAAAAAAAAU/aH2BUoUrJXw/s72-c/lm_w3svc_root_unavailable.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-8758973398182699014</id><published>2008-02-19T10:02:00.000-08:00</published><updated>2008-02-19T10:25:15.828-08:00</updated><title type='text'>.net, soap, web services and enums....</title><content type='html'>imagine you have a class like this one&lt;br /&gt;&lt;i&gt;&lt;p&gt;&lt;br /&gt;public class BaseClass&lt;br /&gt;{&lt;br /&gt;    public BaseClass() {}&lt;br /&gt;    &lt;br /&gt;    protected TheEnum enumcho=TheEnum.First;&lt;br /&gt;    public TheEnum Enumcho&lt;br /&gt;    {&lt;br /&gt;       get { return enumcho; }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/i&gt;&lt;br /&gt;where TheEnum is some enumeration.&lt;br /&gt;&lt;br /&gt;now, if you want to use and export this class in a webservice, you would decorate it with [Serializible] and expect everything to work just fine...&lt;br /&gt;so thought i until i discovered that the class generated for the proxy would look like&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;[System.....]&lt;br /&gt;public partial class BaseClass&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;yes, you saw that correctly - its just an empty class, and something like this is enough to drive one crazy...&lt;br /&gt;took me long 2-3 hours to find a solution, and it was hard because as always - the oracle (google) is only giving helpful answers when you're asking the correct questions&lt;br /&gt;&lt;br /&gt;.net serialize enum?&lt;br /&gt;c# enum soap?&lt;br /&gt;enum how serialize soap c#?&lt;br /&gt;enum not serialized web service c#?&lt;br /&gt;&lt;br /&gt;and a big load of similar ones, to not much help until on one of the searches i came upon &lt;a href="http://objectsharp.com/cs/blogs/bruce/archive/2006/01/31/3792.aspx"&gt;this one&lt;/a&gt;, where bruce johnson wrote about his problems playing with java/.net web services and especially &lt;a href="weblogs.asp.net/wim/archive/2004/04/14/112995.aspx"&gt;this one&lt;/a&gt; where 'Wim' had problems serializing enum fields. and that probably wouldn't be of much help either had he not mentioned this weird thing: &lt;b&gt;"all fields are serialized, except the enum field...strange thing is, when i &lt;u&gt;rename&lt;/u&gt; the member field, it does get serialized"&lt;/b&gt; - this was enough to get me started to look for the crazy explanation for the problem (remember?-when all the logic conclusions lead to nothing its time to  look for the illogical answers...)&lt;br /&gt;&lt;br /&gt;and i finally found it when i added a setter method to the property, like this...&lt;br /&gt;&lt;i&gt;&lt;p&gt;&lt;br /&gt;    public TheEnum Enumcho&lt;br /&gt;    {&lt;br /&gt;       get { return enumcho; }&lt;br /&gt;       set { int i=0; }&lt;br /&gt;    }&lt;br /&gt;&lt;/p&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;to my relief this solved the problem and the property was finally added to the definition of the class in the proxy....breathe...and relax....3 hours waisted... &lt;br /&gt;&lt;br /&gt;hope this will be helpful to somebody else too :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-8758973398182699014?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/8758973398182699014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=8758973398182699014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/8758973398182699014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/8758973398182699014'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2008/02/net-soap-web-services-and-enums.html' title='.net, soap, web services and enums....'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-478529058643461764</id><published>2007-07-01T15:27:00.000-07:00</published><updated>2007-07-01T15:47:50.563-07:00</updated><title type='text'>idisposable implementation</title><content type='html'>just needed to implement idisposable so i can use a class in a &lt;i&gt;using&lt;/i&gt; clause and came upon &lt;a href="http://msdn2.microsoft.com/en-us/library/ms244737(VS.80).aspx"&gt;this link&lt;/a&gt;&lt;br /&gt;looks interesting and useful&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-478529058643461764?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/478529058643461764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=478529058643461764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/478529058643461764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/478529058643461764'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2007/07/idisposable-implementation.html' title='idisposable implementation'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-2118099790205469986</id><published>2007-06-30T07:17:00.000-07:00</published><updated>2007-06-30T07:21:09.207-07:00</updated><title type='text'>Parser Error - Could not create type 'XXX'</title><content type='html'>i was creating a small test web service.&lt;br /&gt;when i wanted to test it, but adding reference to another project, i got this error in the wizard 'Parser Error - Could not create type 'XXX''&lt;br /&gt;and it suggested that i check the proxy settings blah-blah-blah&lt;br /&gt;a quick search on google got me &lt;a href="http://blog.devstone.com/aaron/archive/2006/05/16/1600.aspx"&gt;this&lt;/a&gt;, but i quickly found out the actual reason when i went to the iis settings - my test service was in .net 2.0, while the settings for the virtual directory were for .net 1.1&lt;br /&gt;after i changed this all went smoothly....&lt;br /&gt;&lt;br /&gt;just 2c...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-2118099790205469986?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/2118099790205469986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=2118099790205469986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2118099790205469986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/2118099790205469986'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2007/06/parser-error-could-not-create-type-xxx.html' title='Parser Error - Could not create type &apos;XXX&apos;'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-114197445779217305</id><published>2006-03-09T22:54:00.000-08:00</published><updated>2006-03-09T23:14:51.106-08:00</updated><title type='text'>mysql connector/net and cyrillics</title><content type='html'>im writing this application that stores client data in mysql 4.0.18 and i see that any data in cyrillics or unicode is stored as ??????.&lt;br /&gt;wtf??&lt;br /&gt;i search and search the web for solution and found .... nothing !?!?&lt;br /&gt;i remembered i had a similar problem once with software for another client, and at that time a had given up and used MySQL ODBC instead.&lt;br /&gt;this time i decided to continue the search and found &lt;a href="http://bugs.mysql.com/bug.php?id=10870"&gt;this post&lt;/a&gt; (http://bugs.mysql.com/bug.php?id=10870) and a little bit &lt;a href="http://www.openwin.org/mike/uc2005/"&gt;somewhere here&lt;/a&gt;.&lt;br /&gt;so the solution is to add charset=utf8 to your connection string.&lt;br /&gt;why is it so hard to find the solution to a problem that should be common ? or, hmm, ok - maybe i really should've read the mysql manual properly...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-114197445779217305?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/114197445779217305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=114197445779217305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/114197445779217305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/114197445779217305'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2006/03/mysql-connectornet-and-cyrillics.html' title='mysql connector/net and cyrillics'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-111876195275533323</id><published>2005-06-14T08:04:00.000-07:00</published><updated>2005-06-14T08:12:32.760-07:00</updated><title type='text'>building pwlib</title><content type='html'>i have to add 729 codec support to my application. for that i downloaded &lt;a href="http://www.voxgratia.org/downloads.html"&gt;voxgratia's patched version&lt;/a&gt; of openh323 and pwlib and started the fight for building them.&lt;br /&gt;what i kept getting was some unresolved externals, so after a long, long struggle i noticed that the compiler-encoded method string which ptlib looks for for linking in ptlibd.def differs from the string in the ptlibsd.lib which is being linked.&lt;br /&gt;so i decided to replace the strings in ptlibd.def with the correct ones in ptlibsd.lib. everything compiles fine so far, i wonder if it will also work fine ....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-111876195275533323?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/111876195275533323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=111876195275533323' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111876195275533323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111876195275533323'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/06/building-pwlib.html' title='building pwlib'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-111505658295247399</id><published>2005-05-02T10:53:00.000-07:00</published><updated>2005-05-03T03:29:31.040-07:00</updated><title type='text'>file upload with asp.net</title><content type='html'>while playing with some basic asp.net stuff i got this&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Maximum request length exceeded. &lt;br /&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;br /&gt;&lt;br /&gt;Exception Details: System.Web.HttpException: Maximum request length exceeded.&lt;br /&gt;&lt;br /&gt;Source Error: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Stack Trace: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[HttpException (0x80004005): Maximum request length exceeded.]&lt;br /&gt;   System.Web.HttpRequest.GetEntireRawContent() +895&lt;br /&gt;   System.Web.HttpRequest.GetMultipartContent() +58&lt;br /&gt;   System.Web.HttpRequest.FillInFormCollection() +256&lt;br /&gt;   System.Web.HttpRequest.get_Form() +50&lt;br /&gt;   System.Web.UI.Page.GetCollectionBasedOnMethod() +70&lt;br /&gt;   System.Web.UI.Page.DeterminePostBackMode() +47&lt;br /&gt;   System.Web.UI.Page.ProcessRequestMain() +42&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;solution was found &lt;a href=http://www.dotnet247.com/247reference/msgs/32/160309.aspx&gt;here&lt;/a&gt;: simply increase HttpRuntime maxRequestLength in machine.config&lt;br /&gt;&lt;br /&gt;But I bet you knew this already, didn't you ? :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-111505658295247399?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/111505658295247399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=111505658295247399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111505658295247399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111505658295247399'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/05/file-upload-with-aspnet.html' title='file upload with asp.net'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-111503477092945902</id><published>2005-05-02T04:41:00.000-07:00</published><updated>2005-05-02T04:52:50.930-07:00</updated><title type='text'>knoppix 3.8 and usb modems</title><content type='html'>so i decided to get a try at linux and got a &lt;a href=knoppix.net&gt;knoppix&lt;/a&gt; cd. successfully changed the language to english (by default the cd boots in german) and wanted to browse the net. but i couldn't. rebooted to windows and started searching for a solution. after about 3 hours on almost every forum i search everybody said that it is either impossible ot very difficult to get an usb device running under linux. wtf ?&lt;br /&gt;that got me even angrier so i did what i've should've done from the start: went to the source and searched the knoppix site for questions and luckily through reference from another post got to this thread:&lt;br /&gt;&lt;a href = http://www.knoppix.net/forum/viewtopic.php?p=82705&gt;&lt;br /&gt;http://www.knoppix.net/forum/viewtopic.php?p=82705&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;initially that guy's advice didn't work for me, but was great for a start.&lt;br /&gt;i installed the &lt;b&gt;usbnet&lt;/b&gt; package and as this wasn't enough i remembered having read somewhere about the &lt;b&gt;tulip&lt;/b&gt; package and that it was somehow connected with usb devices on linux. after that i run the network card configuration and .... voila! welcome internet! :) the only remark is that for broadcast 192.168.1.255 should be used, the network card wizard came up proposing another ip...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-111503477092945902?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/111503477092945902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=111503477092945902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111503477092945902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111503477092945902'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/05/knoppix-38-and-usb-modems.html' title='knoppix 3.8 and usb modems'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-111002758567258721</id><published>2005-03-05T04:51:00.000-08:00</published><updated>2005-03-05T05:02:27.073-08:00</updated><title type='text'>[Access Driver]Cannot open any more tables</title><content type='html'>I'm writing this app which reads heavilly from an access 'database'. all goes well, but after a large dataload, the odbc driver began throwing this message at me! how dare you, little woodpecker! ;)&lt;br /&gt;i paniced at first and even began considering whether i should move to ADO.NET (the app is written in c#). i searched and searched the net (&lt;a href="google.com"&gt;Google&lt;/a&gt;) and a note in a &lt;a href="http://groups-beta.google.com/group/symantec.support.devtools.pc.dbanywhere.using/browse_thread/thread/60b7ceb97fd35ed8/49de70da555c43d5?q=Access+Driver+Cannot+open+any+more+tables#49de70da555c43d5"&gt;&lt;br /&gt;message&lt;/a&gt; got me startled - " ...and then close the statement object once the result set query has been accessed..." and this - "..You may also want to close the result set as you say after you are done with it...".&lt;br /&gt;of course i close my datareaders and without this notion, but this constant repeating of "close this, close that" got me an idea - and then suddenly i noticed that OdbcCommand has a Dispose() method. and thats was it! after i close the datareader, now i also dispose of the odbccommand object and everything goes smoothly....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-111002758567258721?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/111002758567258721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=111002758567258721' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111002758567258721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/111002758567258721'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/03/access-drivercannot-open-any-more.html' title='[Access Driver]Cannot open any more tables'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110969750537664932</id><published>2005-03-01T09:13:00.000-08:00</published><updated>2005-05-02T10:57:15.603-07:00</updated><title type='text'>activex - save graphics to file</title><content type='html'>i'm writing an mfc activex control and want to save its visuals to a file. so how should i do this? the graphics on the control are created through GDI+, so should i go through Graphics contents to an Image, or may be through CDC?&lt;br /&gt;&lt;br /&gt;so far i have this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;CDC* pdc = GetDC();&lt;br /&gt;&lt;br /&gt;RECT rect;&lt;br /&gt;GetClientRect(&amp;rect);&lt;br /&gt;&lt;br /&gt;Graphics graphics(pdc-&gt;GetSafeHdc());&lt;br /&gt;Bitmap bitmap(rect.right - &lt;br /&gt;rect.left, rect.bottom - &lt;br /&gt;rect.top, &amp;graphics);&lt;br /&gt;&lt;br /&gt;CLSID pngClsid;&lt;br /&gt;GetEncoderClsid(L"image/jpeg", &amp;pngClsid);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bitmap.Save(fineName, &amp;pngClsid, NULL);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;but it just outputs a black screen, which is understandable&lt;br /&gt;&lt;br /&gt;luckily my search led me to GdipCreateBitmapFromGraphics method and this post: &lt;br /&gt;http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=37541&amp;lngWId=1&lt;br /&gt;&lt;br /&gt;where this guy - "Avery" - gives a great hint: it turns out creating the Image this way only gives a blank Image compatible with the Graphics object. to get the visuals all the graphics have to be done on a Graphics object derived from this Image. so i rewrote my drawing procedure to a function to be called with a Graphics object and depending on what i want - i would pass either the Graphics derived from the CDC in OnDraw, or the one needed for saving the image to a file... voila!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110969750537664932?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110969750537664932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110969750537664932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110969750537664932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110969750537664932'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/03/activex-save-graphics-to-file.html' title='activex - save graphics to file'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110951344068617004</id><published>2005-02-27T06:00:00.000-08:00</published><updated>2005-05-03T03:31:27.793-07:00</updated><title type='text'>openh323.ocx</title><content type='html'>i'm implementing a VoIP module for a client and found a very usefull &lt;a href = "http://www.geocities.com/rddamian/"&gt;atl control&lt;/a&gt; over the great &lt;a href ="openh323.org"&gt;OpenH323&lt;/a&gt; opensource project. &lt;br /&gt;the problems is damian's control doesnt work with a gatekeeper. after much struggle, goolgle searches and code studying, i think i found a solution:&lt;br /&gt;i turns out damian's control doesn't properly initialize its endpoint, thus failing to register the gatekeeper.&lt;br /&gt;so the fix is:&lt;br /&gt;modify MyH323EndPoint's Initialise() method like this - &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;BOOL MyH323EndPoint::Initialise()&lt;br /&gt;{&lt;br /&gt;  noFastStart = FALSE;&lt;br /&gt;  InitialiseCodecs();&lt;br /&gt;  return StartListener("*");&lt;br /&gt;//original version goes like this: return TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;thats it. now the end point properly starts its listeners and you can use a gatekeeper for PC-Phone calls&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110951344068617004?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110951344068617004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110951344068617004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110951344068617004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110951344068617004'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/02/openh323ocx.html' title='openh323.ocx'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110581429530387726</id><published>2005-01-15T10:19:00.000-08:00</published><updated>2005-01-15T10:38:15.303-08:00</updated><title type='text'>delegates in java</title><content type='html'>so, this c# project that i have to convert to java uses delegates. i hadn't worked with delegates in c# before, so studying the delegates usage in the project was quite interesting. after some research i decide not to use reflection or anything else as a means to implement delegates in java. instead i take a to rewrite the code that uses delegates to simple function calls constructs. delegates here are used to make a templates approach to some tasks - for example visit a hierarchy of objects each of which may have subhierarchy and so on. with delegates used it makes it easy to go down the tree of objects and apply some operation on each of them AND - what is important -the operation would be a delegate so many operations can be executed by calling a single method that traverses the tree. or sort of :)&lt;br /&gt;so my decision - as i cant use template code - is to generally make a tree traversal in a distinct method for each operation.&lt;br /&gt;so instead of&lt;br /&gt;&lt;i&gt;&lt;blockquote&gt;&lt;br /&gt;		internal override void visitHierarchy(CollectionVisitor visitor)&lt;br /&gt;		{&lt;br /&gt;			base.visitHierarchy(visitor);&lt;br /&gt;	&lt;br /&gt;			foreach (SomeObject Obj in collection1)&lt;br /&gt;				Obj.visitHierarchy(visitor);&lt;br /&gt;			foreach (SomeObject Obj in collection2)&lt;br /&gt;				Obj.visitHierarchy(visitor);&lt;br /&gt;		}&lt;br /&gt;&lt;/blockquote&gt;&lt;/i&gt;&lt;br /&gt;there will be a similar block of code, but implemented for the different operations that need to be executed:&lt;br /&gt;&lt;i&gt;&lt;blockquote&gt;&lt;br /&gt;		public void visitWithOperation1()&lt;br /&gt;		{&lt;br /&gt;			super.visitWithOperation1();&lt;br /&gt;	&lt;br /&gt;			foreach (SomeObject Obj in collection1)&lt;br /&gt;				Obj.visitWithOperation1();&lt;br /&gt;			foreach (SomeObject Obj in collection2)&lt;br /&gt;				Obj.visitWithOperation1();&lt;br /&gt;		}&lt;br /&gt;&lt;/blockquote&gt;&lt;/i&gt;&lt;br /&gt;and&lt;br /&gt;&lt;i&gt;&lt;blockquote&gt;&lt;br /&gt;		public void visitWithOperation2()&lt;br /&gt;		{&lt;br /&gt;			super.visitWithOperation2();&lt;br /&gt;	&lt;br /&gt;			foreach (SomeObject Obj in collection1)&lt;br /&gt;				Obj.visitWithOperation2();&lt;br /&gt;			foreach (SomeObject Obj in collection2)&lt;br /&gt;				Obj.visitWithOperation2();&lt;br /&gt;		}&lt;br /&gt;&lt;/blockquote&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;of course there isn't foreach in java... but hope you get the idea....&lt;br /&gt;so this is a little bit tedious approach to rewriting delegates in java, but i hope it works for now&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110581429530387726?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110581429530387726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110581429530387726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110581429530387726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110581429530387726'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2005/01/delegates-in-java.html' title='delegates in java'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110376067581263161</id><published>2004-12-22T16:05:00.000-08:00</published><updated>2004-12-22T16:11:15.813-08:00</updated><title type='text'>vs.net 2003: Could not copy temporary files to the output directory.</title><content type='html'>ok, after fighting this problem for weeks, i gave up trying to have all my project output to the same folder. wrote a copy file post build event and calmed down. the strange thing is this (single output folder for all projects) setup worked very well for months and "suddenly" it started failing - first once at a time, then to an extent where i could not normally work... i read and read posts, blogs, newsgroups, articles, tips and shits with no productive result. &lt;br /&gt;oh, well -  after all it is a do-once operation; hope i wont have to fix it again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110376067581263161?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110376067581263161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110376067581263161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110376067581263161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110376067581263161'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/vsnet-2003-could-not-copy-temporary.html' title='vs.net 2003: Could not copy temporary files to the output directory.'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110374964436542109</id><published>2004-12-22T13:59:00.000-08:00</published><updated>2006-04-18T06:35:17.496-07:00</updated><title type='text'>mscorwks.dll could not be loaded</title><content type='html'>i have sent a new application to one of my customers. suddenly they complain that they recieve a strange message that i have never encountered:&lt;br /&gt;"mscorwks.dll could not be loaded". what the hell ? they have followed my instructions and have installed .Net Framework 1.1 and some additional libraries, so what might be the problem ??  good thing there's &lt;a href ="google.com"&gt;google&lt;/a&gt; and the &lt;a href="www.dotnet247.com"&gt;.Net 247&lt;/a&gt; community; and this article - http://www.dotnet247.com/247reference/msgs/41/207197.aspx.&lt;br /&gt;so i have mixed a debug and release version ? hmm but why didnt i get that message locally then ? the Mystery of the Sith.....&lt;br /&gt;&lt;br /&gt;Edit: so, after i read &lt;a href=http://thedotnet.com/howto/work135510.aspx&gt;this thread&lt;/a&gt; i began to get suspicious and checked with my clients exactly what version of the .Net Framework they had and.... voila! they had 1.0.xxxx when 1.1 was needed! man, this remote work is getting so confusing sometimes....&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110374964436542109?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110374964436542109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110374964436542109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110374964436542109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110374964436542109'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/mscorwksdll-could-not-be-loaded.html' title='mscorwks.dll could not be loaded'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110328866912819489</id><published>2004-12-17T04:58:00.000-08:00</published><updated>2004-12-17T05:08:39.320-08:00</updated><title type='text'>set the course</title><content type='html'>so i finally made my mind on how to proceed with converting the application from c# to java. a helpfull resource was &lt;a href=http://www.sys-con.com/story/?storyid=43657&amp;DE=1&gt;Infragistics' experience&lt;/a&gt;. so for now my goal is to have all the c# classes into their java counterparts, with limited functionality in lots of places in order to only have the things moving... you know - the hardest thing is to get the wheel spinning (or was it the ball rolling? :) , everything comes to its place afterwards&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110328866912819489?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110328866912819489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110328866912819489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110328866912819489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110328866912819489'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/set-course.html' title='set the course'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110267772806070775</id><published>2004-12-10T03:15:00.000-08:00</published><updated>2004-12-10T03:22:08.060-08:00</updated><title type='text'>save sent mail</title><content type='html'>as a long time user of &lt;a href=yahoo.mail.com&gt;yahoo mail&lt;/a&gt; i was used to "copy message to sent folder" or whatever option. recently i noticed that yahoo mail team have removed this option from the compose email window. a quick search in &lt;a href=google.com&gt;google&lt;/a&gt; sent me to a &lt;a href=http://help.yahoo.com/help/us/mail/send/send-05.html&gt;yahoo mail support page&lt;/a&gt;, where i learned that there is new option that would only allow me to save all my sent messages. i used to only save some important messages and now they want me to save all or no sent emails. &lt;br /&gt;isn't this a kind of stupid ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110267772806070775?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110267772806070775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110267772806070775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110267772806070775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110267772806070775'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/save-sent-mail.html' title='save sent mail'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110258856304109824</id><published>2004-12-09T02:28:00.000-08:00</published><updated>2004-12-09T02:36:03.040-08:00</updated><title type='text'>windows disappeared</title><content type='html'>another white hair on my head - im converting a .Net program to Java and needed some java resources. So I downloaded &lt;a href = "http://www.brunswickwdi.com/java_basics"&gt;BIE&lt;/a&gt;, which i thought might be usefull, and very quickly decided that it is not. however when i tried to uninstall it - Booom ! i noticed that my Windows dir was gone, and something was eating the Program Files folder... crazy...beware of badly written software, kids.. and make backups!... often!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110258856304109824?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110258856304109824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110258856304109824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110258856304109824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110258856304109824'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/windows-disappeared.html' title='windows disappeared'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9533623.post-110258808871729854</id><published>2004-12-09T02:24:00.000-08:00</published><updated>2004-12-09T02:28:08.716-08:00</updated><title type='text'>uno posto numero uno</title><content type='html'>wow, isn't it a little scary... my first post to this blog. i am gonna use it as an online diary and notes holder for my programming tasks. maybe someone else beside me will find it usefull - wish me luck !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9533623-110258808871729854?l=esdeeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://esdeeblog.blogspot.com/feeds/110258808871729854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9533623&amp;postID=110258808871729854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110258808871729854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9533623/posts/default/110258808871729854'/><link rel='alternate' type='text/html' href='http://esdeeblog.blogspot.com/2004/12/uno-posto-numero-uno.html' title='uno posto numero uno'/><author><name>Esdee</name><uri>http://www.blogger.com/profile/15136472730982726419</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
