Mothea Anil Kumar

Greenhorn
+ Follow
since Aug 01, 2005
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 Mothea Anil Kumar

Hi,

I am using struts+hibernate+spring technologies in my project. I'm using DB2 as data base. I'm having the below problem in using batchUpdate() method for one of the delete method. Actually this delete method has to delete around 40 thousand of records at atime. So i'm breaking up the count and deleting for every 1000 rows using the below spring,

private void deleteFromMainTablesExc(String deleteQuery,
StringBuffer idsList) throws SQLException {
try{
log.info ("idsList:"+ idsList);
StringTokenizer strToken = new StringTokenizer(idsList.toString(),",");
final List idsListTemp = new ArrayList();
while (strToken.hasMoreElements()){
idsListTemp.add((String)strToken.nextElement());
}
jdbc.batchUpdate(deleteQuery,new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement ps, int i) throws SQLException {
ps.setInt(1, Integer.parseInt((String)idsListTemp.get(i)));

}
public int getBatchSize() {
return idsListTemp.size();
}
});
log.info ("deleteFromMainTablesExc:"+idsList);
}catch(Exception e){
System.out.println("Exception is :" +e);
e.printStackTrace();
}
}

My problem is for one of the data set it worked fine without having any issues. But it's not working for another dataset.
Is there any max limit for batch update statement? Or anything needs to be fix from code point of view?

Below error i'm getting while executing my program,

org.springframework.jdbc.UncategorizedSQLException: (executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator@19a0feb]): encountered SQLException [Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.]; nested exception is com.ibm.db2.jcc.c.ud: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
com.ibm.db2.jcc.c.ud: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
at com.ibm.db2.jcc.c.i.a(i.java:358)
at com.ibm.db2.jcc.c.zc.b(zc.java:2877)
at com.ibm.db2.jcc.c.zc.a(zc.java:2666)
at com.ibm.db2.jcc.c.zc.executeBatch(zc.java:2478)
at com.ibm.db2.jcc.c.zc.executeBatch(zc.java:1365)
at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:743)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:450)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:469)
at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:734)
at com.kroger.accounting.ad.jdbc.DBPurgeService_Production.deleteFromMainTablesExc(DBPurgeService_Production.java:319)
at com.kroger.accounting.ad.jdbc.DBPurgeService_Production.deleteFromMainTables(DBPurgeService_Production.java:351)
at com.kroger.accounting.ad.jdbc.DBPurgeService_Production.removeDataFromMainTable(DBPurgeService_Production.java:490)
at com.kroger.accounting.ad.jdbc.DBPurgeService_Production.purge(DBPurgeService_Production.java:266)
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:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy5.purge(Unknown Source)
at com.kroger.accounting.ad.process.PurgeProcess.<init>(PurgeProcess.java:28)
at com.kroger.accounting.ad.process.PurgeProcess.main(PurgeProcess.java:48)
Exception in thread "main" java.lang.RuntimeException: (executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator@19a0feb]): encountered SQLException [Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.]; nested exception is com.ibm.db2.jcc.c.ud: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
at com.kroger.accounting.ad.process.PurgeProcess.<init>(PurgeProcess.java:38)
at com.kroger.accounting.ad.process.PurgeProcess.main(PurgeProcess.java:48)
11 years ago
Can you please explain me how to access and save files in server2 using SFTP(This is available on server1 & server2).
Can you please explain me clearly what you are saying. For your infomration, no application is running on Server2.
Hi All,

My application is running in the server1. I know how to save the file in server1. Is there any way to save the uploading file in server2 while uploading through application.

Thanks,
-Anil.
thank you srikanth..

anyways..I have just kept value = \"" + FK + "\" and it worked..
12 years ago
JSP
I have a session value() which I am able to get in the class file Navigationtag.java.

In this code the session value is in a string FK.
String FK=(String)pageContext.getSession().getAttribute("facilityKey");
out.print("FK"+FK);

but I have to display the session value in a searchbox with the code
input type=\"text\" size=\"9\" maxlength=\"8\" value=\"'$FK'\" name=\"searchbox\"/

Here the session value is not displayed instead it is taking the string '$FK' and displaying on the browser.I need the value to be displayed.
12 years ago
JSP
Hi,
I'm working on migration project from WAS5 to WAS6. In my project technologies are Struts+Spring+Hibernate. And Hibernate Interceptor is also used for Audit purpose. And Transations are also configured. My problem is, when i'm saving one form it's not showing any error in DAO methods and everytihng goes fine. After this it's calling the AuditInterceptor class method like onFlushDirty(),postFlush() etc. Once these methods are executed it's throwing the error, as java.lang.StringIndexOutOfBoundsException. Due to this exception hibernate Transaction manager is rolling back all the transactions. And i'm unable to find where the exact error is coming to fix this issue.
Any ideas to locate where the error is coming. Thanks.

Error description is,
java.lang.StringIndexOutOfBoundsException
at java.lang.String.charAt(String.java:415)
at com.ibm.db2.jcc.c.q.n(q.java:1830)
at com.ibm.db2.jcc.c.q.a(q.java:638)
at com.ibm.db2.jcc.c.q.a(q.java:1180)
at com.ibm.db2.jcc.c.zc.a(zc.java:1253)
at com.ibm.db2.jcc.c.zc.hb(zc.java:2991)
at com.ibm.db2.jcc.c.zc.d(zc.java:2004)
at com.ibm.db2.jcc.c.zc.d(zc.java:2376)
at com.ibm.db2.jcc.c.zc.S(zc.java:557)
at com.ibm.db2.jcc.c.zc.executeUpdate(zc.java:540)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:948)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:615)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:687)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:640)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2361)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:447)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:375)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:241)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy10.update(Unknown Source)
at com.kroger.accounting.rem.struts.actions.FacilityAction.update(FacilityAction.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.kroger.accounting.rem.struts.actions.REMBaseAction.dispatchAction(REMBaseAction.java:463)
at com.kroger.security.actions.KrogerSecureStrutsDispatchAction.execute(KrogerSecureStrutsDispatchAction.java:44)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at com.kroger.accounting.framework.Controller.process(Controller.java:16)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Hi,

Thanks for your reply. But i don't know how to do this procedure.Can you please explain me of doing this.

Thanks,
-Anil
Hi,

I'm using eclipse 3.2 and Application server as JRUN4. So suggest me how to connect JRUN4 in Eclipse 3.2. Is there any plug-in available for this.If so give the downloadable path for that.

Thanks,
-Anil.
Hi,

Wants to know the information of WebSphere V6.1 will support EJB 2.0 ?
If it supports means, how long it supports ? Asking this question because current version of EJB is 3.0 supported by WAS V6.1.
Where will i get information of WAS V6.1 supported java technologies with versions ?

Anil.
14 years ago
Hi,

I saw the Migration Wizard book. It's very helpful to me. But my current version of WAS 5.1 is running on Linux. I want to put WAS V6.1 on Windows.
Is this possible through Migration wizard ?? Bcoz we have to give the path of existing server home directory while doing the Migration Process.

Anil.
14 years ago
Hi,

Our J2EE application is running on WebSphere Server v5.1.
Application contains both WEB and EJB modules.

What are neccessary steps to follow for deploying already
running J2EE application from v5.1 to v6.1 ??

Thanks,
-Anil.
14 years ago
Hi,

Can any body please give me the code for uploading an excel file using servlets. With out using any third party controls. I tried but failed.

Thanks,
-Anil
14 years ago
Hi Mark,

Thanks for your reply.

Your are saying is correct. But i'm facing the situation where i have to continue to saveOrUpdate next records even if previous record was failed.

Please give answer to my questions.

Thanks,
-Anil
Hi,

Is it possible to work on more than one transaction with the same hibernate session object ?? I'm getting some problem by doing like this,
.
.
........
........

Session session = sessionFactory.getSession();
Transaction tx = null;

While(totalObjects) {
tx = session.beginTansaction();
try {
session.saveOrUpdate(Object);
tx.commit();
} catch(Exception e) {
tx.rollback();
throw e;
}
......
......
}

In the above code in while loop , in every condtion i'm creating new transaction and save or updating the object.If any error occurs i'm rollback the transaction. Problem is, if Object is saving means there is no problem. If it's not saving means , I rollback the transaction and for the next objects it's giving the error related to session.(error).

My question is ,
--> Is it necessery to close the session every time ??
--> Is it not possible to use more than one transation in same session ??

Any body help me please.It's urgent.
Thank's in advance.

--Anil