代码改变世界

随笔档案-2011年07月

Connection pool

2011-07-31 15:39 by 一一九九, 1379 阅读, 收藏,
摘要: wikipedia中的解释: 在软件工程中connection pool 是对database connections 的cache, 主要作用是重用对已经建立的数据库请求,提升数据库执行命令的效率。为每一个用户打开和维护一个数据库连接,尤其是对数据驱动的网站来说,成本是非常高并且很浪费资源的。在connection pool 中,当一个连接被创建时就被放到了Pool中,当一个新的请求到达时这个... 阅读全文

NHibernate in Action 2.3 Basic Configuration

2011-07-31 12:03 by 一一九九, 220 阅读, 收藏,
摘要: Generallly, NHibernate is used in two and three tiered client /server applications, with nhibernate deployed only on the server, the client application is usually a web browser, but windows client ap... 阅读全文

NHibernate in Action 2.3 Basic Configuration

2011-07-31 12:03 by 一一九九, 153 阅读, 收藏,
摘要: Generallly, NHibernate is used in two and three tiered client /server applications, with nhibernate deployed only on the server, the client application is usually a web browser, but windows client ap... 阅读全文

NHibernate in Action 2.2 Understanding the architecture

2011-07-30 16:05 by 一一九九, 212 阅读, 收藏,
摘要: NH API in a layered architecture 包含那么几个部分: 被Application调用执行CRUD的接口。包含 ISession, ITransaction, IQuery, ICriteria. 配置NH的结构。 包含Configuration 允许Application回调响应NHibernate内部事件的部分,比如IInterceptor, ILifecycle,... 阅读全文

NHibernate in Action ch2 Hello NHibernate 读后

2011-07-30 09:35 by 一一九九, 221 阅读, 收藏,
摘要: (一)对象的标识以及Database到Object的映射 If two instances of Employee have the same identifier value, they represent the same row in the database。 这里指的是如果两个对象具有同样的ID,那么他们代表数据库中的同一行。也就是说这是Database到Object映射的一个维度,是通... 阅读全文

转: Python WSGI fastcgi

2011-07-28 22:01 by 一一九九, 2384 阅读, 收藏,
摘要: 一、什么是 WSGI 。 在认识 flup 之前,得先认识一下 WSGI 。 WSGI 的全称为: Python Web Server Gateway Interface v1.0 (Python Web 服务器网关接口),它是 Python 应用程序和 WEB 服务器之间的一种借口,更多详细的细节,可以参考 PEP333 。 它的作用,类似于FCGI 或 FASTCGI 之类的协议的作用。 WS... 阅读全文

MySQL 数据库的备份和恢复

2011-07-28 19:44 by 一一九九, 116 阅读, 收藏,
摘要: 参见:http://www.niutian365.com/blog/article.asp?id=48 参见 http://imysql.cn/mysql_backup_and_recover 参见: http://imysql.cn/mysql_backup_and_recover 主要是通过Mysqldump 命令 和MySQL命令来执行, 备份出来的内容不是二进制文件,而是SQL文件,将所有... 阅读全文

以Object 为中心和以Database为中心进行应用程序设计导致的后期修改的分析

2011-07-16 17:00 by 一一九九, 244 阅读, 收藏,
摘要: 现在回想起来,当时触发了下面的这一段的思考的主要原因是当时在学习NHiberante的时候,对于基于NHibernate应用程序的设计方式的区别,是直接设计数据库然后设计对象模型还是先设计对象模型然后由对象模型生成数据库,当时主要是考虑到后期修改的影响。 进行分析的依据是从数据处理的过程来考虑的,主要是获取数据、处理数据、展现数据的过程,针对如果Schema修改的话,将会影响数据库处理的各个方... 阅读全文

NHibernate In Action CH2 Hello NHibernate

2011-07-16 16:20 by 一一九九, 195 阅读, 收藏,
摘要: 看了一下还是07年写的Blog,想来看NHibernate已经断断续续将近两年了。写的有些凌乱,整理一下。 记录了建立NHibernate Project的步骤: (一) Set up the Project,add assembly reference 添加引用。在Project中添加Reference: NHibernate.dll Using NHibernate, NHibernate.C... 阅读全文

Convert Object to int

2011-07-14 23:14 by 一一九九, 2352 阅读, 收藏,
摘要: 在调试代码的时候碰到了这样的一行代码: int a = (int)(Object(double)); 此时报错,表明是InvalideCastException。 当时表示很奇怪: 为什么 int a = (int)(doble type)) 能够通过呢? 网上搜了一下,StackOverFlow上有个帖子: http://stackoverflow.com/questions/745172/be... 阅读全文

Nhibernate Beginner ch12 odds and ends

2011-07-12 01:47 by 一一九九, 214 阅读, 收藏,
摘要: Unit of work and burrow Unit Of work pattern: http://www.martinfowler.com/eaacatalog/unitOfWork.html when you’re pulling data in and out of a databased, it’s important to keep track of what you’ver ... 阅读全文

NHibeginner Ch8 writing Queries

2011-07-10 17:21 by 一一九九, 145 阅读, 收藏,
摘要: Definitely one of the strongest reasons for switching to NHibernate has to be the way that you query data . The basic data access object in order for out data access objects to be effective for our u... 阅读全文

NHbernate begginner ch7 Configuration

2011-07-09 22:39 by 一一九九, 149 阅读, 收藏,
摘要: Configuration is simply a way to provide NHibernate with the information it requires to connect to the database map our classes, and generally provide us with all of its benefits. The basic of configu... 阅读全文

Nhibernate Beginner ch6 I am a logger

2011-07-09 11:57 by 一一九九, 194 阅读, 收藏,
摘要: log4net has three major objects that we need to be concerned with – the log manager, loggers, and appenders. Imagine that log4net is a big bucket into which we throw all of the items we want to log o... 阅读全文

NHibernate beginner ch5 todo:

2011-07-05 07:16 by 一一九九, 177 阅读, 收藏,
摘要: todo: cfg.AddAssembly(typeof(Address).AssemblyQualifiedName); 为啥会报错? cfg.AddAssembly(typeof(Address).AssemblyQualifiedName); 在NHibernate的源码中,这句话是这样的: public Configuration AddAssembly(string assemblyN... 阅读全文

NHibernate Beginner ch5

2011-07-04 18:20 by 一一九九, 330 阅读, 收藏,
摘要: Using what we have already learned, NHibernate knows enough about our data structure and our objects. now it’s time to let NHibernate connect to the database. Think of an NHibernate session as an abst... 阅读全文

NHibernate Begginner Ch4

2011-07-03 22:13 by 一一九九, 227 阅读, 收藏,
摘要: Our next major hurdle in the implementation of NHibernate is database mapping. In the last few chapters, we learned how to create tables to hold our data and how to create classes to hold that data in... 阅读全文

NHibernate Begginner Ch3

2011-07-02 19:46 by 一一九九, 186 阅读, 收藏,
摘要: NHibernate Begginner Ch3 one of the greatest things that NHibernate brings to us is the ability to work directly with objects instead of having to deal with DataSets or DataReaders. Before we can use... 阅读全文

NHibernate Beginnger ch2

2011-07-02 18:05 by 一一九九, 175 阅读, 收藏,
摘要: NHibernate Beginnger ch2 Technorati 标签: NHibernate Like the foundataion of a building, the structure of your database forms the base for your entire application. if you take a little care and build it... 阅读全文