Duran's technical life
踏踏实实学技术,认认真真做研究。

2005年9月9日

从MySql5中运行本地脚本创建数据库,当插入中文字段时发生“data too long for column”错误。上网一查,发现多字节用户大都碰到了这种情况。google搜索网上的解决方法大都是要将数据库的编码方式为GBK或UTF8,可我在安装MySql时就选择了UTF8格式。原来错误原因是本地的脚本文件不是UTF8编码的,用记事本或UltraEdit将编码转为UTF8后问题解决。再次强调,JSP页面,数据库联接接方式,数据库创建,…,都须一致使用UTF8编码!

BTW,MySql最近借着Web2.0的浪潮风头很劲啊,techn orati(好像这几天被GFW filter了),flickr,del.icio.us等一批网站都是用了MySql。MySql还专门在首页开了一大块来炫耀。
posted @ 2006-07-14 19:12 Duran's technical life 阅读(9154) | 评论 (4)编辑 收藏
 
Installed JDK6 (Mustang) beta and Eclipse3.2 . As Sun promised , Swing library, especially the WindowsLookAndFeel feels much better. It’s hard to tell the difference between a Swing drawn window and a WINXP native window. Developing Java desktop applications is worth considering. Mattise, a free easy-to-use WYSIWYG Swing UI designer, is the only reason for many to use the tedious NetBeans. Recently, Genuitec provided Matisse4Eclipse, which is an implementation of Matisse that integrates its functionality into MyEclipse Workbench to enable the easy creation of Swing applications with Eclipse. So the only reason to use NetBeans has gone.
posted @ 2006-07-13 22:17 Duran's technical life 阅读(1026) | 评论 (0)编辑 收藏
 
去年7月决定考研后暂停了对Java技术的学习。录研上后专心开发导师负责的项目,到4月份从深圳出差回来后又忙着做毕设。快一年的时间没跟新这,几乎都要abandon了。百度刚开放了百度空间的注册,不过看起来不咋的。选国外的BSP会面临随时伟大的GFW过滤掉的后果。总的来说,BlogJava还是很适合post技术方面的东西,优点是流量大,被google收录快;缺点就是没有trackback。前几天下午跑到图书馆看了看上半年的程序员,新鲜玩意并不多。SOA,这个被预测为06年最热点的技术,并没有什么有趣的文章,或许这个名词还是没有个明确的含义和应用。在学校里,IBM的SOA大赛倒是举办的风风火火。JavaEE5,JDK 6的发布还是给Java界带来不少有趣又实用的新东东,比如annotation,persistence API和script supporting。得跟上技术前进的步伐了,以后技术的笔记还是发这里,平日的杂想就写在我的MSN space上。
posted @ 2006-07-13 22:14 Duran's technical life 阅读(316) | 评论 (0)编辑 收藏
 

@title [笔记]事务处理

#1 Transaction Propagation Behavior
Required:Excute within a current tx, create a new one if none exists.
Supports: Excute within a current tx, execute without a tx if none exsits.
Mandatory: Excute within a current tx, throw an exception if none exists.
Requires New: Create a new tx and excute within the tx, suspend the current tx if one exists.
Not Supported: Excute without a tx, suspend the current tx if none exsits.
Never: Excute without a tx, throw an exception if a tx exsits.

#2 Transaction Isolation Level[1]
#2.1 Concurrent Problem
Dirty Reads: 脏读(脏数据指已更新,还没提交的数据)。事务T1读取到事务T2中的脏数据。

Unrepeatable Reads: 不可重复读。事务T1检索到某行后,事务T2更新并提交了该行,若事务T2再次检索该行,则会看到不一样的结果。

Phantom Reads: 虚读。事务T1检索到符合某条件的行集后,事务T2插入并提交了满足该条件的新行,若事务T2再次按该条件检索,则会看到以前不存在的行“Phantom”。

#2.2 Isolation Level
+---------------+-------+------------------+-----------+
|Isolation Level|Phantom|Unrepeatable Reads|Dirty Reads|
+---------------+-------+------------------+-----------+
|Read Uncommited|   Y   |         Y        |     Y     |
+---------------+-------+------------------+-----------+
|Read Commited  |   Y   |         Y        |     N     |
+---------------+-------+------------------+-----------+
|Repeatable Read|   Y   |         N        |     N     |
+---------------+-------+------------------+-----------+
|Serializable   |   N   |         N        |     N     |
+---------------+-------+------------------+-----------+

#3 Timeout

#4 ReadOnly Transaction
只读事务保证了多条查询SQL的在事务级别的读一致性。JDBC和数据库会对只读事务做一些优化。

[1] C.J.Date, An Introduction to Database Systems 7th.

posted @ 2005-09-09 13:09 Duran's technical life 阅读(702) | 评论 (1)编辑 收藏