Showing entries 33576 to 33585 of 44802
« 10 Newer Entries | 10 Older Entries »
Getting Hibernate and MySQL's "ON DUPLICATE KEY UPDATE" Feature to Play Nice Together...

MySQL has a handy feature, that allows you to turn an INSERT into an UPDATE if a unique or primary key duplication is detected:

http://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html

A common usage pattern for this is “lazy initialization“ of a row in a database, which is exactly what my team was using it for yesterday to solve a problem in the backend for version 2.0 of the MySQL Enterprise Monitor. However, we ran into an issue where Hibernate would throw an exception complaining that when the INSERT was turned into an UPDATE, it couldn‘t retrieve the generated primary key value (we are using auto increments on this particular table, as it‘s not a high insertion-rate table).

To understand why this happens, you have to know a little bit about how Statement.getGeneratedKeys() works with MySQL‘s JDBC driver. …

[Read more]
Speaking at PLUG in Provo, Utah, Tonight

In the Columbus, Ohio, airport right now waiting to board my plane to Salt Lake City. Tonight, I will be speaking on Join-Fu at the PLUG (Provo Linux User Group). Ryan Simpkins asked that I speak "at a very advanced level" and so that's what I will be doing! We'll see how the PLUG members handle my new set of slides on Intermediate Join-Fu that I have been working on...

I will post the slides a little later today after the PLUG meeting. I'm really looking forward to meeting Ryan and the other folks from PLUG and getting a short tour of Omniture, a large web analytics company that uses MySQL (no, it's not Overture. Totally different. One of those is now extinct.)

Long Live Open Source

“Don’t worry about people stealing an idea. If it’s original, you will have to ram it down their throats.”
— Howard Aiken

MySQL is back on Open Source track and that is definitely the best news for all (including community, MySQL and Sun as well). I think that now Sun/MySQL have agreed to the importance of community, it becomes community's responsibility to give them more reasons to believe so. Let's participate like never before.

Kaj, in his post says "...model to be useful for both those who spend money to save time, and those who spend time to save money". This is what Open Source is, isn't it?

All in all, a decision most awaited and …

[Read more]
Mitigating the risk of license changes

This is just a very short note about the recent license change from LGPL to GPL made by the author of extJS. When choosing an open source product make sure that the contributors are fragmented across enough organizations to prevent any chance of being able to do a license change. If that is not the case make sure that the community is large enough so that you have a good chance at succeeding with a fork if the need arises. In the case of extJS the later seems to be the case. As such the license change itself is not soooo big an issue, since a lot of people do not consider their frontend code to be proprietary anyways. The source is there for all to see. So for the most part people are fine considering their frontend to be licensed under the GPL. That being said, extJS guys are …

[Read more]
Prepared statement gotchas

I spotted an interesting blog post over on Planet OSDB about prepared statements gotchas. It illustrates very well the issue that prepared statements have been plagued with since their inception: namely that they can severely hurt performance (even though they are considered to improve performance by most people).

Just briefly: Why do we even care for prepared statements? For stateless web applications the benefits are mainly protection against SQL injection and better readability. In some rare cases in theory also better performance if the same statement is executed multiple times in the same request. The disadvantage is that for most web applications queries are rarely executed more than once and therefore the separation of parsing/planning and execution just means that there is an …

[Read more]
MySQL Is back to Open Source Camp ?

Looking at Kaj's Blog Annoucement MySQL has pulled back on the plans to release portions of the servers as close Source only.

I am extremely happy to hear these news ! This is good for MySQL as a company, MySQL customers and MySQL users.

I'm hoping Community feedback was serious contributer to this decision, though I know there were a lot of Internal discussions as well. In any case this sends a great message to community - Speak up and you may be heard.

I also hope Marten Mickos took this decision being convinced rather than getting the order from the top as this is only one battle in "what is going to be opensource" war

Anyway thank you everyone who made this happen, in particularly Monty, which I know fought a lot for this.

[Read more]
JavaFX as Rich Internet Application Platform

JavaOne wrapped up on Friday. We hosted individuals from across the globe, and from every industry: consumer electronics and gaming, to enterprise IT, space exploration, factory automation, the automotive industry, academia - like the network itself, Java delivers something for nearly everyone, everywhere.

This year's biggest announcements centered around Java's role in the future of rich internet applications (or RIA's). What's a rich internet application? It depends on your perspective - from mine, it's any network connected application that persists in front of a user, typically outside a browser, that can operate when disconnected from the network.

On the one hand, I'd claim Java's always been a RIA platform - before the world really wanted one. Early Java applets delivered interactivity, but at the expense of development complexity and, in the early days, performance - when a browser, and more recently Javascript, would …

[Read more]
Using a DELETE w/ a JOIN and LIMITing the number of rows deleted.

I've come up with some interesting workarounds for missing features using @session variables and I'd like to share one with you today: DELETE ... JOIN ... LIMIT N;

okay, so we've got two tables, one with many duplicates and one with no duplicates.
We want to join the tables using 'id', but only want to delete N duplicates from t1.
MySQL's DELETE does not include LIMIT support when JOIN is used, so we need to work around
that using some fancy footwork:


mysql> select * from t1;
+------+------+
| id | abc |
+------+------+
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
| 1 | 1 |
+------+------+
8 rows in set (0.00 sec)

mysql> select * from t2;
+----+------+
| id | xyz |
+----+------+
| 1 | 1 |
+----+------+
1 row …

[Read more]
My Name Is?

Stewart.

With a t at the end. Not a d.

Get it wrong once, possible mistake.

When I correct you, and you do it *again* and *again*, I want to slap you in the face with a keyboard.

It’s especially bad when you’re replying to my email, as my name is spelt correctly at least THREE TIMES right in front of you (Twice in “To: Stewart Smith <stewart@…>” and again in “On X, Stewart Smith wrote:”.

(and if you’re wondering why I’ve tagged this post with “sun” and “mysql” it’s because some of you people are the worst offenders)

kthxbye

MySQL: Free Software but not Open Source

The title of MySQL’s website states that they are the world’s most popular open-source database. This is false; MySQL is not an open-source database. That assertion is a fact, not an opinion. MySQL is Free Software, licensed under the GNU GPL. People frequently use the two phrases “Free Software” and “Open Source Software” as synonyms, but there are very large, very important differences. The difference between Free and Open Source Open Source is much more of a development methodology than a philosophical standpoint.

Showing entries 33576 to 33585 of 44802
« 10 Newer Entries | 10 Older Entries »