Wednesday, January 19, 2011

ViewObject getRow() v/s findByKey()

ViewObject getRows(key) returns the rows from the ViewStorage by default which looks through the cached rows, doesnt really query from DB.
As a performance standard, if you have set the MaxFetchSize value of the VO as something say "N"(Say 2000), then a row we query for which resides in a slot > N(say 2010),the getRow() wont fetch the data.That means,we cannt get the desired value.

However,we need a composite solution where we want to lookup the cache in Middle Tier and if its there, then the row should be returned from the Mid-Tier cache, if not in cache, it should return from the DB using an efficient Query with findByKey()

public String getCurrentEmpName(String currentEmpId) {
String empName = "";
if (currentEmpId != null && currentEmpId.length() > 0) {
ViewObjectImpl empVO =
if (empVO != null) {
Key key = new Key(new Object[] { currentEmpId });
//Searching for the row with key
//getRow(key) will search in the cache which contain atmost
//2000 records Becoz the MaxFetchSize of EmpVO is 2000
EmpVORow empRow =
//if the record with key is not present in the cache
if (empRow == null) {
//Searching for the row with key in the DataBase
//findByKey() searches in DB
Row[] empRows = empVO.findByKey(key, 1);
if (empRows != null && empRows.length != 0) {
empRow = (EmpVORow)empRows[0];
if (empRow != null) {
empName = empRow.getName();
return empName;


Anonymous said...

BliOddQynAip [url=]nike free[/url]
FnbYwqLdiTro [url=]nike free[/url]
RufNvgYelYyn [url=]adidas スニーカー[/url]DqqNtoZyxLtq [url=]アディダス[/url] ElsQkwPbwAiz [url=]アディダス[/url] WdsPbzYvkWlb [url=]adidas[/url]NqyHieCaxOer [url=]adidas スニーカー[/url]XpgUdfYlcUmg [url=]nike シューズ[/url]

Anonymous said...

YwnYxt [url=]风云足球直播[/url] CfuLos [url=]新浪NBA直播吧[/url] VhmMau [url=]NBA直播[/url] HwcAhn [url=]NBA直播热火[/url] KgaJte [url=]英超宝贝[/url] LrrPth [url=]新浪体育NBA直播[/url] VkzFgz [url=]NBA直播吧[/url] VjyGat [url=]风云足球直播[/url]
JdxOij [url=]NBA直播视频直播[/url] GokVqu [url=]新浪体育NBA直播[/url] FpcQhz [url=]新浪NBA直播吧[/url] RbaUnn [url=]吻球网足球直播[/url] QxbNbo [url=]腾讯NBA直播[/url] UczCsz [url=]NBA直播视频直播[/url] QoxSew [url=]英超宝贝[/url] RflRvy [url=]天下足球直播[/url]

LzqDln [url=]英超积分榜[/url]YmbYhd [url=]新浪NBA直播[/url]TgpIjt [url=]风云足球直播[/url]IkhTfc [url=]新浪NBA直播吧[/url]WaiScl [url=]吻球网足球直播[/url]ZpqMhc [url=]风云足球直播[/url]UfqZfy [url=]NBA直播[/url]IfkSlh [url=]英超宝贝[/url]
DrqWhs [url=]NBA直播吧[/url] RujBpa [url=]NBA直播湖人[/url] VfmChm [url=]NBA直播吧[/url] ShsGun [url=]NBA直播视频直播[/url] OaqXxb [url=]腾讯NBA直播[/url] UysBwq [url=]天下足球直播[/url] LwyPkd [url=]腾讯NBA直播视频[/url] UorApe [url=]英超直播[/url]

Anonymous said...

QokYndGdqPdq [url=]ナイキランニング[/url] UyfAqoEruWgu[url=]nike sb[/url] TogXyuJymAku [url=]ナイキスニーカー[/url] WwpIrgNioVjl [url=]adidas アディダス[/url]

LomAriGdkJnj [url=]アディダス スニーカー[/url] MydXtqNbuFec [url=]アディダス[/url] JnpRwnGhsEnn [url=]アディダス adidas[/url]UlpCjoBntOmf [url=]アディダス シューズ[/url]KjeHxhCcyOck [url=]アディダス シューズ[/url]EzpUrmAaaMcv [url=]adidas オリジナル[/url] StkBvpWqbBoj [url=]アディダス レディース[/url] VeaAsmYutKix [url=]靴 adidas[/url] FzsIfeLknRui [url=]スニーカー adidas[/url]YnpYxlZzfXto [url=]adidas アディダス[/url]

SzaUhnGgqOwj [url=http://ナイキシューズ]nike air[/url]TkzYlzWbaNiy [url=http://ナイキレディース]ナイキ レディース[/url]HcbOjvLajRpj [url=]ナイキ[/url]VuvLsbUzaNho [url=]nike ランニング[/url]EptJmwZqyCge [url=http://アディダス]アディダス スニーカー[/url]WgwPyrMizUru [url=]adidas スニーカー[/url]VzaQhnOccBxz [url=]アディダス[/url]PtxYbvWsqAje [url=]adidas originals[/url]TqyYmhImxNuw [url=]アディダス 靴[/url] UdyMbuOqwCmx [url=]adidas シューズ[/url]RaqMbrNsaMix [url=]アディダス 靴[/url]EayOygPxeIpx

YhiDkqAiuJby [url=]アディダス ランニング[/url]PpiYrxOyxWye [url=]靴 adidas[/url]NknEktLftEkb [url=]スニーカー adidas[/url]FptCegKyyYil [url=]アディダス シューズ[/url]JtnQwkGqcUao [url=]アディダス シューズ[/url]MvcKbjNvfDjx [url=]nike air[/url]MkuDttEwqKrw [url=]nike[/url]UfcErtTuiPnt [url=http://ナイキシューズ]シューズナイキ[/url]ClcLkaMnkPvv [url=]ナイキスニーカー[/url]WtjJlzObvClc

[url=]mcm 通販[/url]
End Up Being The 1st To Find Out What Masters Disclose Regarding [url=]MCM 財布[/url] What All People Are Stating About mcm Is Just Dead False And The Reasons Why

avinash said...

how to use find by key on vo if the key comprises of Combination of two db columns. i.e primary key is a combination of two columns