views:

514

answers:

1

I've been having numerous connection problems between my Java (JPA+Hibernate+CommonsDBCP) app connecting to MySQL. I've done the research, tweaked all the settings with validation queries, timeouts, tests before X, etc.

This path led me to another StackOverflow question comparing DBCP and C3PO. From the responses, I've decided to definitely try out C3PO instead.

Along the way, however, I've found another option: named pipes, since both the app server and MySQL are running on the same machine. Trouble is, I can't find many details about this method.

So here's my question: what is going to be the most STABLE option: Named pipes, or TCP w/C3PO? Any stories or knowledge would be most welcome as well as answers.

+1  A: 

Well, it depends on your situation:

Who is connecting to MySQL? Clients from a slow LAN or WAN link? Or localhost?

TCP/IP has the benefit of connection backlogging, where named pipes do not, so for slow links or WAN, I would go with TCP/IP; otherwise, named pipes.

Also, local named pipes run in kernel mode so they're going to be pretty fast.

Try looking at http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx

Even though it speaks about MS SQL Server, the Local named pipes running in kernel mode should still apply.

Elan Hasson