关于jboss死循环的问题,愁啊

qiusi 04-08-10

关于jboss死循环的问题,愁啊

一个jboss243的项目,经常出现死循环!!!
update的地方不说,即使只有最简单的select语句
的地方也会出现。

我查到即使只使用select语句,jboss也会update。
那这样如何避免deadlock呢?

一个场景:
同时访问一个简单的open order页面,居然有不小的
几率出现deadlock!!!

兄弟们,有办法解决么?在下谢过先

qiusi
2004-08-10 19:07

如果是entity bean的设置问题,请问该如何设置?

qiusi
2004-08-11 10:03

这是jboss.xml的BMP缓冲配置,我一直认为是这里的问题
有朋友能帮忙看看么?
<container-configurations>
<container-configuration>
<container-name>Users BMP EntityBean Cached</container-name>
<call-logging>false</call-logging>
<container-invoker>org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker</container-invoker>
<container-interceptors>
<interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
<interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
<instance-cache>org.jboss.ejb.plugins.EntityInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</persistence-manager>
<transaction-manager>org.jboss.tm.TxManager</transaction-manager>
<container-invoker-conf>
<RMIObjectPort>4444</RMIObjectPort>
<Optimized>True</Optimized>
</container-invoker-conf>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>5</min-capacity>
<max-capacity>10</max-capacity>
<overage-period>600</overage-period>
<resizer-period>600</resizer-period>
<max-bean-age>600</max-bean-age>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
<MaximumSize>100</MaximumSize>
<MinimumSize>10</MinimumSize>
</container-pool-conf>
<commit-option>A</commit-option>
</container-configuration>

banq
2004-08-11 11:41

关键在调用Select 和Update的Session bean处,可贴些代码看看。

qiusi
2004-08-11 13:08

就这个打开order的bean也无法同时访问!!
接这么一个项目真倒霉,:(

public class OpenOrderSelectionBean extends BusinessBean {
public void perform (ValueObject inParm, ValueObject outParm) throws Exception {
InitialContext ctx = new InitialContext();

Object objref = ctx.lookup(Constant.ENTITY_MERCHANT);
MerchantHome merchantHome = (MerchantHome) PortableRemoteObject.narrow(objref, MerchantHome.class);

objref = ctx.lookup(Constant.ENTITY_ORHEADER);
OrheaderHome orheaderHome = (OrheaderHome) PortableRemoteObject.narrow(objref, OrheaderHome.class);

objref = ctx.lookup(Constant.ENTITY_CUSTOMER_ORDER_NO);
CustomerOrderNoHome customerOrderNoHome = (CustomerOrderNoHome) PortableRemoteObject.narrow(objref, CustomerOrderNoHome.class);

SimpleDateFormat formatter = new SimpleDateFormat("MMM dd yyyy");

//History Kept
String merchantOid = (String) inParm.get("merchantOid");
Merchant merchant = (Merchant) merchantHome.findByPrimaryKey(merchantOid);
int historyKept = merchant.getHistoryKept();

inParm.set("historyKept", Integer.toString(historyKept));

int archiveFlag = '0'; // orders not archived
String orderSubType = "1"; // orders that are master(ipd) or ip
String orderStatus = "0"; // orders that are not closed

Collection resultSet = orheaderHome.findIpOpenOrders(merchantOid, archiveFlag, orderStatus, historyKept);

ArrayList openOrderArr = new ArrayList(resultSet);
Iterator iterator = openOrderArr.iterator();
ArrayList rowData = new ArrayList();
int itemCount=0;
if (!openOrderArr.isEmpty()) {
while (iterator.hasNext()) {
HashMap rowItemHash = new HashMap();
//Casting to Order Header remote
Orheader orheader = (Orheader) iterator.next();
//System.out.println("ORheaderOid = " + orheader.getOrheaderOid());
//Casting to Customer Order No remote
Collection col = customerOrderNoHome.findByOrheaderOid(orheader.getOrheaderOid());
Iterator itr = col.iterator();
ArrayList orderNoArr = new ArrayList();
while (itr.hasNext()) {
HashMap orderNoHash = new HashMap();
CustomerOrderNo customerOrderNo = (CustomerOrderNo) itr.next();
orderNoHash.put("orderNo", customerOrderNo.getOrderNo());
orderNoArr.add(orderNoHash);
}

rowItemHash.put("orheaderOid", orheader.getOrheaderOid());
rowItemHash.put("orderNoArr", orderNoArr);
rowItemHash.put("createDate", formatter.format(orheader.getCreateDate()));

//Item Count
itemCount ++;
Integer itemCountInt = new Integer(itemCount);
rowItemHash.put("itemCount",itemCountInt.toString());
rowData.add(rowItemHash);
}
}
outParm.set("searchResultRow", rowData);
Integer totalRecords = new Integer(openOrderArr.size());
outParm.set("displayRows", totalRecords.toString());
outParm.set("totalRows", totalRecords.toString());
}
}

2Go 1 2 下一页