Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,640
|
Comments: 51,263
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 100 words

Take a look here to see what it takes to solve my previous challange. It was extremely hard to get it to work in all scenarios, and I am pretty sure that there are additional edge cases that I have not thought of, but for now, all the tests are green. I also have a 100% repreducable (on several machines) VS crashing bug, which is about the fifth that I know of.

I actually started to put MsgBox.Show() in the code, and had a serious JavaScript deja-vu as a result...

time to read 3 min | 418 words

There is probably a bug in Dynamic Proxy that causes it to output overrides to methods in such a way that when you reflect over the generated types, you get two methods for each overriden methods, instead of a single overriden method. I looked into it in detail a while ago, and I couldn't figure out how to make it work like I expect it to. The code that it generate is verifable, so this is something that the CLR supports, but I am not quite sure that I understand what the semantics for this is.

So, what does this have to do with Brail? NHibernate makes extensive use of DynamicProxy in order to increase performance and to defer loading, which meant that any application using NHibernate had this issue. Now, Brail is a dynamically typed langauge (well, not really, but that is close enough), which means that it uses Reflection to resolve properties and methods that are called. Because of Dynamic Proxy generated what is basicaly a duplicate method, that failed.

At the basic level, it meant that a call like this:

${Blog.Name}

Would turn into:

blog.GetType().GetProperty("Name").GetValue(blog, null);

(This is actually very far from how it is wokring but again, that is close enough to make sure you understand the problem.) Now, GetProperty("Name") woudl throw an AmbigiousMatchException, since it actually found two properties called "Name", one of the original class, and the second on the proxied class.

Why am I boring you with this? The fix for this was fairly simple, but it involved simply replacing the way Boo (which is what Brail is using) type system with my own. The fast that I could do that with roughly 350 LoC is quite amazing to me.  This also means that I can actually preserve the dynamic nature of Brail, but behind the scene generate strongly typed accessors (think Dynamic Methods), which would elevate any concerns about reflection costs.

The code is in the Castle's trunk now, so you can start using it.

time to read 2 min | 232 words

So yesterday I sat down to see what I can about the remaining Rhino Mocks bug, when I was suddenly and viciously attacked by a wild beast. After the inital confusion, it turn out that the mad barking and the slavering wasn't, as I concluded at first, an indication that I am edible, but rather that Rose has found a bug in Dynamic Proxy.

It is not often that I turn to a canine for a bit of advise about runtime IL generation, but Rose is something special. Below you can see her concentrating on the part that handle generic method invocations.

(Image from clipboard).png

And here is me trying to get a fair share of the keyboard, I believe in Pair Programming, but Rose just won't let go of the keyboard. She has a remarkable words per minute count, although her spelling is a bit off at time (but then again, so odes mine).

(Image from clipboard).png

I don't blame her for the spelling, she is just a puppy, five months old and still growing. She is a Caucasian Shepherd, which means that she is likely to get much bigger (she is about the size of a full grown German Shepherd now).

time to read 1 min | 111 words

Well, if you are reading this I have successfully moved to orcs web.

The transfer was fairly smooth, except they don't support MySQL. That wasn't an issue, as a matter of fact, since I am using Cuyahoga, it was a simple matter to change the config and make it work with SQL Server. I was worried about transferring the data, but it looks like MySQL has fairly strongly export capabilities, including into formats that SQL Server can consume.

Beyond that, it was a breeze...

Now I only have to wait for the DNS records to update.

time to read 14 min | 2646 words

I am posting this because I am extremely annoyed. I moved from my previous host because of reliability issues, I had to do it fairly quickly, so I didn't have time to really ask around and find out the best host. I went to webhosting4life because it was fast to setup, and I believed that they were big enough to be competent.

(Image from clipboard).png

I do not have a very big site, or a very complex setup, I run two applications, one needing MySQL, the other needing SQL Server. Neither of which is particularily tasking on the server.

As you can see, I had 6 outages in the last 20 days, some of them lasting mutliply hours. In nearly all cases, the reason that I was given was:

There is a routing issue on that server. Our tech is working on it now.

I could accpet it once or twice, but when it go to this level... below is a chat transcript of me and a tech from webhosting4life. It is complete with spelling mistakes and everything. As a result of this, and the evasive answers that I got, I am now on the lookup for a new host.

Notice that the operator simply left the chat when I tried to get additional information about the root cause of the problem. The chat equilent of hanging in my face! They have "Email our CEO" link on the help desk page, which I used to send a question regarding the frequent outages, I never even got a "Thank you for email us".

Powered by SightMax
Welcome to sightmax2.webhost4life.com. alvin will be right with you.
alvin
hello
Ayende Rahien
my database is down
Ayende Rahien
http://www.ayende.com/Blog/
Ayende Rahien
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
alvin
could you please let me have a check.
Ayende Rahien
yes
alvin
There is a routing issue on that server. Our tech is working on it now.
alvin
Could you please check it out later? If it still have problem. please open a urgent ticket in our helpdesk system. Thanks.
Ayende Rahien
This is the 5th time that I heard about a routing issue with the servers.
Ayende Rahien
Each of those time, it was because I had noticed that my site was down!
Ayende Rahien
That is not an acceptable way of hosting.
alvin
I am sorry about this, we are working on the issue now. Thanks.
Ayende Rahien
How can I get an answer from an authorized source about this issues?
Ayende Rahien
I would like to know what it the underlying reason for the frequent outages and the actions taken to fix this.
alvin
Could you please open a ticket about this issue, and our senior tech will give more details to you. Thanks.
Ayende Rahien
304056
Ayende Rahien
I did
Ayende Rahien
How can I get guarantees about uptime?
Ayende Rahien
I am not expecting five nines, but I do expect more than 80%
Ayende Rahien
Hello??
alvin
Dear customer, it seems that there is a routing issue on the network that make the connection for your site can't connect to the database. Our technician are working on the issue now. Sorry for any inconveniences caused. If you want a quick fix, please change the connection string to IP first.
Ayende Rahien
Nice copy/past.
Ayende Rahien
Now, can you tell me why you are recommending that I would do something that you explicitly tell me NOT to do on your site?
Ayende Rahien
It concerns me that there is a canned response for this question.
alvin
As there a routing issue in the data center, and can let the web servers to reslove the domain name, and the quick fix is using IP to instead.
Ayende Rahien
And why does it occur every other day?
Ayende Rahien
I cam to you because you were supposed to be a proffesional hosting service, with good technicians that would NOT mess the routing in the data server every day
alvin was removed from the chat.
alvin has terminated the chat session.

 

time to read 2 min | 335 words

Scott Hanselman has an amusing post about working with the .Net OpenID library, which is written in Boo. I suggest that you would read it, but a few of notes first:

  • I had to go through a similar process when porting Brail from Boo to C#. I have to say that the code afterward has a lot more cruft than before.
  • Scott is making a reference to my Boo.Reflector project, I will try to update it to Reflector 5.0, but I can't make any promises. Getting coherent code is not a trivial task, and there are a lot of smarts that went into the C#/VB langauges in Reflector to make it look seemless.

The most important point, though, is about Scott's comment regarding Mono's licensing:

ASIDE: Be aware that Mono is GPL'ed, but since Mono produces IL, and Mono libraries are CLS compliant, you can reference them in your Windows .NET applications happily, and they'll work fine 99.9% of the time. Adding a Mono library to my Windows .NET CLR program doesn't make it run under Mono, it's just referencing a library. Some people, like myself (yesterday) look down on this like we look down on C# programs referencing Microsoft.VisualBasic.dll, but hey, it's tested code I didn't have to write...you'll no doubt see my own personal epiphany coming later in this post...

Mono is not GPL'ed. It uses several licenses over several components, but only the compiler itself is GPL'ed. You can see the details here, but basically, the libraries (including Mono.Security) comes freely, with no strings attached (MIT X11 licenses, to whom it may concern).

 

time to read 1 min | 179 words

The guys from Eleutian had done it again, with a post that explains how you can use Windor and Rhino Mocks in order to make it easy to create the tests.

Jacob is raising some concerns about this approach:

Speed/peformance? Does making the container such an integral part of the test fixtures hurt performance? Setup has to be longer when we're creating the container the way we are. Does this matter? Only as long as the time saved when writing tests is larger than the time it takes to run them, which I'm sure is the case...

Windsor setup is generally fast enough, but doing it per test is probably going to slow the tests down. It certainly makes the tests a lot easier to write.

Oh, and Beta 2 of Rhino Mocks 3.0 should be out later today...

time to read 13 min | 2573 words

I feel that I gave it too much already, and I am giving up. A workaround is too good for this issue.

Given the following class defination:

public class Dog

{

       public static MethodInfo LastCall = null;

       public class BarkInvocation<T>

       {

              public T Bark()

              {

                     LastCall = (MethodInfo)MethodInfo.GetCurrentMethod();

                     return default(T);

              }

       }

 

       public T Bark<T>()

       {

              return new BarkInvocation<T>().Bark();

       }

}

Can you make this print true?

public class Program

{

       [STAThread]

       static void Main(string[] args)

       {

              Dog d = new Dog();

              d.Bark<IList<string>>();

              Type returnType = Dog.LastCall.ReturnType;

 

              List<string> strings = new List<string>();

 

              Console.WriteLine(returnType.IsInstanceOfType(strings));

       }

}

 

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. API Design (10):
    29 Jan 2026 - Don't try to guess
  2. Recording (20):
    05 Dec 2025 - Build AI that understands your business
  3. Webinar (8):
    16 Sep 2025 - Building AI Agents in RavenDB
  4. RavenDB 7.1 (7):
    11 Jul 2025 - The Gen AI release
  5. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
View all series

Syndication

Main feed ... ...
Comments feed   ... ...