一般序列化的方式有: 1. 通过JDK 的Serializable接口序列化成二进制字节流 RMI,EJB,分布式应用中需要用到 注意序列化的是类的数据成员,而不是方法 1.1 可以通过Externalizable接口( readExternal, writeExternal)定制Seriealizable过程 1.2 三种情况不会序列化 1)static field,序列化的是对象的状态 2)transient 类变量 3)父类成员变量(由父类负责序列化) 2. 序列化成XML XML-RPC,SOAP等序列化成XML进行Web Service之类的远程调用 常用的框架有:xstream, JAXB,etc. 3. 序列化成JSON(Javascript Object Notation) 轻量级的序列化方式
JAX-WS是JAX-RPC的下一个版本,它们的区别有: 1. JAX-RPC支持SOAP 1.1 JAX-WS支持SOAP 1.1 和 SOAP 1.2 2. JAX-RPC 对应的是Java 1.4 JAX-WS 对应的是 Java 5 3. JAX-RPC 有自己的XML - Java 映射模型 JAX-WS 采用 JAXB 4. JAX-WS 引入了异步,动态服务器模型等功能 5. JAX-RPC 支持WS-I Basic Profile V1.0 JAX-WS 支持WS-I Basic Profile V1.1 应该是互操作性更好了
bloom filter 用于测试一个元素是否在一个很大的数据集中。方法是利用多个hash函数,数据集中的元素通过hash函数到一个位置。查询时,做相同的hash查找。只要有一个hash函数没有match到对应的位置就可以判定该元素不在数据集中。所以该方法可能有false positive但一定没有false Negative。 2. suffix array/tree 把一个字符串的所有后缀字符串按字典排序,另外还可以加上LCP(Longest Common Prefix)
Checkfree transaction managed in specified layer: In a dedicated class, say TransactionAdapter, it encapsulated the transaction handling over com.checkfree.isolutions.persist.PersistServer 1. begainTransaction: PersistServer.activate() -> PersistServer.beginTransaction() 2. commitTransaction: PersistServer.commitTransaction() -> PersistServer.deactivate() 3. rollbackTransaction: PersistServer.rollbackTransaction() -> PersistServer.deactivate() try{ txnStarted = TransactionAdapter.beginTransaction(); // boolean flag = checkfree invocation }finally{ if(flag == "success" ) TransactionAdapter.commitTransaction(txnStarted); else TransactionAdapter.rollbackTransaction(txnStarted); }
read-only="true|false" 经常出现在Spring事务配置文件或者annotation 属性中,具体解释如下: 1. Spring documents describes: Read-only status: a read-only transaction does not modify any data. Read-only transactions can be a useful optimization in some cases (such as when using Hibernate). 2. from Google if the transaction is marked as read-only, Spring will set the Hibernate Session's flush mode to FLUSH_NEVER, and will set the JDBC transaction to read-only. 3. Hiberante when a session's flush mode is set to FLUSH_NEVER, two things happen: First, running HQL queries no longer cause Hibernate to flush the session state to the database, which can provide a dramatic performance improvement. Secondly, Hibernate will not flush the changes before commiting the transaction. But the user can still call Session.flush() by hand, causing any modifications to be persisted to database. 4. Oracle When using the Oracle JDBC driver, calling connection.setReadOnly(true) translates into the statement "SET TRANSACTION READ ONLY". This statement limits the types of SQL statements that can be executed during the transaction. Only SELECTS (without 'FOR UPDATE') and a few other statements can be executed. Specifically, no UPDATEs, DELETEs, INSERTs or MERGEs can be executed. This behavior is Oracle-specific. Other RDBMS can have different semantics for read only transactions or simply not support it at all. from: http://www.codeinstructions.com/2009/04/read-only-transactions-with-spring-and.html
WebSphere MQ 提供了处理大消息的两种方法:消息分片和消息分组。 消息分片和消息分组是在 WebSphere MQ 的编程中处理大消息的常用手段,到底采用哪种方式比较合适,需要根据实际的需求而定。如果大消息需要分割成有实际业务意义的一批小消息,那么采用消息分组比较合适;反之,如果大消息无法分割成有实际业务意义的小消息,那么就采用消息分片。
你很想乘上电梯门即将关上的电梯,如果你小跑一下,大多数情况下电梯里的人会等一下你;如果你面无表情,慢悠悠的,大多数情况下准备乘下一班吧。生活需要积极主动。 2. 看到马路上川流不息的车流,你也许会怀疑怎么会有我行进的空间。大多数情况下,你置身于车流时发现还有有你前进的距离。生活需要勇气和实践。宏观的看问题需要让你畏惧。有的问题没有你想象的难。
SOA中为保持交易一致性广泛使用的 Compensation(冲正) 机制