Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Pat Villa

Greenhorn
+ Follow
since Jan 05, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pat Villa

It turns out this was a Transaction timeout issue.
The exception is thrown around 15 minutes after the process started which happens to be the TransactionTimeout setting. It's odd though that sometimes I get the above error and other times the more explicit timeout error.
14 years ago
Hi

I'm encountering the following with our app running on JBoss 3.2.6 on Linux. I've found what seem to be related topics on this but they said that those issues were resolved in an older JBoss release:

First I get several of each of these:
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock , id=com.company.ejb.entity. ChildOldEntityPK @1f61b1
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity. OtherEntityPK @1f0faa
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity. ChildNewEntityPK @202263
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity. ParentNewEntityPK @1f61b0
WARN [Thread-7] org.jboss.ejb.plugins.AbstractInstanceCache:tryToPassivate:163 - Unable to passivate due to ctx lock, id=com.company.ejb.entity. ParentOldEntityPK @1f61a9

Then eventually, an exception is thrown:

ERROR [JMS SessionPool Worker-0] org.jboss.ejb.plugins.LogInterceptor:handleException:294 - TransactionRolledbackLocalException in method: public abstract void com.company.ejb.session.BatchSessionLocal.postBatchTxnWrapper(int,int,java.lang.String) throws com.company.common.exception.BatchException, causedBy:
org.jboss.tm.JBossRollbackException : Unable to commit , tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=tjboss3//251, BranchQual=] status=STATUS_NO_TRANSACTION
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:415)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:456)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:369)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy328.postCashReceiptBatchTxnWrapper(Unknown Source)
at com.company.ejb.session.BatchSessionBean.doPostBatch(BatchSessionBean.java:723)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:709)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:419)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy325.doPostBatch(Unknown Source)
at com.company.ejb.mdb.BatchProcessorBean.onMessage(BatchProcessorBean.java:97)
...
...



Here is the Algorithm. It is run from a SLSB called from a MDB .

ParentOldEntity
- has many ChildOldEntity
- will have corresponding ParentNewEntity
ChildOldEntity
- has corresponding OtherEntity
- will have corresponding ChildNewEntity
ParentNewEntity
ChildNewEntity
OtherEntity






In our tests, failures seem to depend on the number of ChildOldEntity/OtherEntity.

REAL SERVER
usually 1000 ParentOldEntity
will not fail up to around 15000 ChildOldEntity/OtherEntity

VM SERVER
usually 1000 ParentOldEntity
will not fail up to around 4000 ChildOldEntity/OtherEntity


This is our BMP EntityBean configuration.
14 years ago
Hi

I have some currently working code that prints reports from a web app (so no user interaction). In order to save paper during testing, I was hoping I could send print jobs to a Linux Special (pseudo) printer (print to file-pdf). I thought that simply configuring a new printer then using the printer name in my app would do the trick.

I tried this, and my new printer isn't printed out:



These are the only print attributes I set (these are sent to Jasper reports if that matters):



Is this possible at all? Or maybe some extra work is needed for it to work? Or maybe there's another, simpler way?

Thanks
14 years ago
Hi,

Portlet noob here. What I'm trying to do is make my static portlets update parts of itself using AJAX. I've successfully done this when the updating parts do not use portlet tags.

Given the following:

dynamic.jsp
- a jsp fragment that contains urls generated with <portlet:renderURL>

portlet.jsp
- a portlet view that simply jsp:includes dynamic.jsp - this works fine

portlet-refresh.jsp
- a portlet view that contains basic AJAX XmlHttpRequest code that refreshes a portion of itself with dynamic.jsp.

My question is how do I enable dynamic.jsp to access the "portlet" tag when it is called by ajax(portlet-refresh.jsp)? I suppose the problem is that dynamic.jsp doesn't have automatic access to Portlet specific objects/session when it is accessed this way.

Thanks
15 years ago
thanks pradheesh,

Yes, the server was running at the time. Actually what i do is supply this url to an XmlHttpRequest.open call. i get a "permission denied" error (JavaScript side). When i hardcoded the single leading "/" url, it progressed past the XHR.open call. I suppose I could easily just put the url together myself but I'm curious as to why the url ends up with 3 leading "/".
15 years ago
JSP
I have this statement in my jsp:


I'm expecting it to generate:
'/ajax/?command=getgraphdata&portletName=webgraph'

However ${getgraphdataURL} ends up as '///ajax/?command=getgraphdata&portletName=webgraph'

Any ideas on why this is so?

Thanks
15 years ago
JSP
I have the same situation. Studied for 1.3, then when I finished, I found out only 1.4 is available. My voucher's deadline is fast approaching. Oh well, hope I do as well as you
17 years ago
The 1st statement I posted above has corresponding errors similar to this in db2diag.log:
2005-01-19-03.56.49.429000-300 E584200H495 LEVEL: Error

PID : 1696 TID : 1952 PROC : db2syscs.exe

INSTANCE: DB2 NODE : 000 DB : ACCS

APPHDL : 0-303 APPID: J070FE3D.FB58.01018A2287E6

FUNCTION: DB2 UDB, data management, sqldEscalateLocks, probe:4

MESSAGE : ADM5503E The escalation of "5385" locks on table "PACCS

.ACCS_TRADECURTB" to lock intent "X" has failed. The SQLCODE is

"-911".

The rest of the statements didn't have any error show up in db2diag.log. This is probably a log level issue
Thanks David and Adeel for your responses. Sorry for the late reply, I was waiting for the error to occur again. I also don't know how to state this since db2 is quite alien to me. Anyway, I was able to see db2diag.log and match some of the errors to our own log file. Unfortunately, I still can't determine what the other "deadlock" statements are. So what I will show here are the statements that were rolled-back and threw an exception. Here is what I found:


This statement is executed from a scheduler thread with a 30 second interval. The deadlock occurs very often with this statement. This is probably the problem statement but I don't know what's wrong with it.
"UPDATE Trade SET oasys_send_success = 'S' " +
"WHERE bucket_status = 'B' AND status IN ('RL','SB') AND account_id IN " +
"(SELECT account_id FROM Account WHERE oasys_enabled = 'N') " +
"OR product_code NOT IN ('E', 'A') " +
"OR amended_status <> ' '";

The following statements seem to deadlock at random:
"SELECT trade_id " +
"FROM Trade, Account " +
"WHERE Trade.account_id = Account.account_id " +
"AND bucket_status = 'B' " +
"AND status IN ('RL', 'SB') " +
"AND amended_status = ' ' " +
"AND oasys_send_success IN (' ', 'B') " +
"AND trade_source='OASY' " +
"AND oasys_enabled = 'Y' " +
"AND oasys_mode='ALLOC' ";
This statement is executed from a web service(thread)

"UPDATE Trade " +
"SET ...LOTS OF FIELDS..." +
"WHERE trade_id = ?";
This was called from a struts web application(from a request from a web page)

"select count(*) " +
"FROM trade " +
"WHERE account_id LIKE '" +ledgerId+ "%' AND " +
CRITERIA VARIES;
This was called from a struts web application(from a request from a web page)

"SELECT trade_id, account_id, account_type, reference, " +
"product_code, cancel_status, " +
"side, trade_date, qty, " +
"price, " +
"comm_basis, comm_rate, " +
"settle_amt, comm_amt, " +
"execution_time, " +
"symbol_cusip, status, markup_price " +
"FROM trade WHERE bucket_status = 'B'" +
ADDITONAL CRITERIA VARIES +
" ORDER BY trade_date ASC, account_id ASC, product_code ASC, " +
"symbol_cusip, side ASC, amended_status ASC, receive_time ASC";
This was called from a struts web application(from a request from a web page)

Thanks

Originally posted by Adeel Ansari:
No I dont think so.

Are you sure about your settings. Just check it once by getAutoCommit(). Or are several developers working on the same project? if yes then may be some folk set it to false and place it back into pool, assuming a pool there.



Nope, I've searched the code for "setAutoCommit". I've also tried to output getAutoCommit and it came out as "true". BTW, we're using EJB session beans that use DAOs to connect to a datasource on Websphere App Server 5.

Time to use a graemlin

[ January 13, 2005: Message edited by: Pat Villa ]
[ January 13, 2005: Message edited by: Pat Villa ]
Thanks for the reply!

That's why I'm at a loss. I never set auto commit to false in my code. Could it be possible then that the autocommit setting was overridden elsewhere? say the app server or database itself?
We are currently experiencing some deadlocks on our system:
com.ibm.db2.jcc.a.SqlException: The current transaction has been rolled back because of a deadlock or timeout. Reason code "2".

We also get a "68" reason code on other occasions.

Reason codes:
2 - deadlock
68 - lock timeout

We have a system that has more than 1 thread accessing/updating the DB(A scheduler thread, methods triggered by a Web Service, and those triggered from a struts web application). We do not make use of jdbc transactions(using setAutoCommit(false)). I've read that one way to avoid deadlocks is to commit often. Since a connection's autocommit property is set to true by default, and commits are supposed to release locks for the after each execute/statement, doesn't that mean that deadlocks are not supposed to occur?

DB: DB2 v8.1
App Server: WAS 5
OS: IBM AIX/Win2000

Any insight would be appreciated, thanks
I'm just wondering why the Browser URL of the previous screen is the one that is displayed
ex.
1.) I call Servlet1 which loads Jsp1 (URL shown is <a href="http://localhost:9080/Web/<b rel="nofollow">Servlet1</b>)" target="_blank">http://localhost:9080/Web/Servlet1)
2.) I call Servlet2 by submitting (Servlet1 accepts the request, forwards to Servlet2, which loads Jsp2) (URL shown is <a href="http://localhost:9080/Web/<b rel="nofollow">Servlet1</b>)" target="_blank">http://localhost:9080/Web/Servlet1)
3.) I call Servlet3 by submitting (Servlet2 accepts the request, forwards to Servlet3, which loads Jsp3) (URL shown is <a href="http://localhost:9080/Web/<b rel="nofollow">Servlet2</b>)" target="_blank">http://localhost:9080/Web/Servlet2)
I'm using WSAD 5.1 on Win2000
Thanks!
18 years ago
I have the following code in a Session Bean:
...
conn = utilObj.getConnection();
System.out.println( "conn obj = " + conn ) ;
System.out.println( "conn closed = " + conn.isClosed() ) ;
SomeClass someObj = new SomeClass(conn, arg2, arg3);
...
SomeClass constructor just has:
public SomeClass(Connection c, String arg2, String arg3){
System.out.println( "conn obj = " + c ) ;
System.out.println( "conn closed = " + c.isClosed() ) ;
}
Output is as follows:
conn = com.mysql.jdbc.Connection@59f92969
conn closed = false
c = com.mysql.jdbc.Connection@59f92969
conn closed = true
Why did the connection suddenly close when I passed it into a function/constructor?
Environment:
Windows 2000
IBM WSAD 5.1
MySQL 4.0.12
Thanks!
Would isNew() still return true if I haven't sent a reply yet to the client/browser and/or I've already placed attributes into the session? Like below:
Login:
session=req.getSession();
session.setAttribute( "bla" , "bla" ) ;
getServletConfig().getServletContext().getRequestDispatcher( "Servlet2" ).forward( req , resp ) ;
Servlet2:
session=req.getSession(false);
if( session.isNew() ) {
page="Login";
} else {
page="Bla.jsp";
}
getServletConfig().getServletContext().getRequestDispatcher( page ).forward( req , resp ) ;
[ January 29, 2004: Message edited by: Pat Villa ]
18 years ago