l*s
2 楼
比如说,股票的历史记录是子表,把所有的股票汇总起来就是一个总表,怎么通过总表
访问部分子表的数据?还是干脆开目录写文件算了?
访问部分子表的数据?还是干脆开目录写文件算了?
c*e
3 楼
One class has a List- , and exposes it as an unmodifiable list:
public List- getItems() {
syncrhonized (this.items) {
return Collections.unmodifiableList(this.items):
}
}
this.items may be accessed by multiple threads. It is possible new item may
be added or removed while the caller is reading through the list obtained
from getItems(). But what the caller needs is just a best-effort snapshot
of the items, and missing a few new items is ok for the caller. Does the
above method work? In other words, can the caller safely navigate through
the snapshot data without any data corruption?
Maybe a fully thread-safe approach is just to return a new list:
public List- getItems() {
synchronized(this.items) {
return new ArrayList- (this.items);
}
}
是不是太浪费了?
碰到这种问题,大家都是怎样处理的? 谢谢。
public List
syncrhonized (this.items) {
return Collections.unmodifiableList(this.items):
}
}
this.items may be accessed by multiple threads. It is possible new item may
be added or removed while the caller is reading through the list obtained
from getItems(). But what the caller needs is just a best-effort snapshot
of the items, and missing a few new items is ok for the caller. Does the
above method work? In other words, can the caller safely navigate through
the snapshot data without any data corruption?
Maybe a fully thread-safe approach is just to return a new list:
public List
synchronized(this.items) {
return new ArrayList
}
}
是不是太浪费了?
碰到这种问题,大家都是怎样处理的? 谢谢。
z*3
5 楼
data warehousing or data integration? some bi tools ssis
f*n
6 楼
No, it is not safe.
b*e
7 楼
怎么才能开出是明代的?看雕工?
z*e
9 楼
copyonwritearraylist
j*n
11 楼
You'd understand what is Normalization first.
t*e
12 楼
那个synchronized一点用都没有。还是web programming好啊,concurrency都扔给数据
库处理了。
库处理了。
z*3
16 楼
老大,你的意思是不是就是drill down,比如上一个level的时候就是select sum(
price) from stock cube by pub_date,下一个level就是select sum(price) cube by
location,pub_date?如果这样的话,你就建个cube吧。
price) from stock cube by pub_date,下一个level就是select sum(price) cube by
location,pub_date?如果这样的话,你就建个cube吧。
相关阅读
Re: How to debug servlet?Java中如何动态生成对象What are the transaction management benefits of tJAVA 一族How does a client find and connect to a specificRe: a Stupid question.Re: JDE1.2.2 Standard version下如何找classpath的?JDK1.3.0 is really fastRe: weird problem with hashtable--CONCLUSIONTop Ten Errors Java Programmers Make(2)EJB框架示意图Who is EJB technology for?Top Ten Errors Java Programmers Make(7)Re: JDBC and Sybase关于EJBRe: java web server help!!!Re: How to write to printer in Java applicationWhat specific services does a container provide fRe: Client-Server and actionPerformed请教:使用javascript制作online database的方法