balaji anatha padmanaban

Greenhorn
+ Follow
since Jun 18, 2008
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 balaji anatha padmanaban

Hi,

I am using hibernate,struts and EJB in my application.In my development server the application is running without any issues,but in test server
the database connection getting closed at some times and the connetion is resumes within several minutes. I am not able to understand why the connection fails at some times only.I am not able to continue my transaction.

I am using hibernate.cfg.file to make a connection and not using data source .The connection pool for this application is one and it is configured in xml file.
The exception I got:
JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions Closed Connection
[4/6/09 5:30:00:174 EDT] 00000042 JDBCTransacti E org.hibernate.transaction.JDBCTransaction rollback JDBC rollback failed
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1161)
at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
at com.att.it.pie.ls.DOManager.GraniteManager.fetchGrntToPieDtls(GraniteManager.java:522)
at com.att.it.pie.ls.ejb.mdb.ProcessOrder.sendReplyToGranite(ProcessOrder.java:410)
at com.att.it.pie.ls.ejb.granite.PlugInQueryBean.sendReplyToGranite(PlugInQueryBean.java:266)
at com.att.it.pie.ls.ejb.granite.EJSRemoteStatelessPlugInQuery_8270f22d.sendReplyToGranite(EJSRemoteStatelessPlugInQu
ery_8270f22d.java:68)
at com.att.it.pie.ls.ejb.granite._PlugInQuery_Stub.sendReplyToGranite(_PlugInQuery_Stub.java:323)
at com.att.it.pie.ls.delegate.MiscDelegate.callGraniteProcess(MiscDelegate.java:940)
at com.att.it.pie.ls.client.util.GraniteJob.execute(GraniteJob.java:64)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

Please help me find the solution
If you need any more information let me know.

Thanks
Balaji
Thanks Steve,

Now you have to ask yourself if both nodes using the same instance of the class with the method you want to synchronize?

NO,The problem you mentioned is right .Here two different instances are runing at so synchronized is not working for me.So i need to synchronize the object.Can you tell any suggestion?

Thanks..
Hi steve,

Thanks for your reply.

THe problem is the method should not exceute paralley,you mentioned that. "synchronized just prevent it from being executed twice at the same time".This condition we need .
If the method run twice seperately that's not the problem because we are checking the tables with key's.

Our code sending the message using JMS.When we start the server two methods are called paralley(due to two server nodes present in the server) and executed twice.


So why do you have two nodes running the cron job, why not just one?

we configured only once in our code .I am not aware of how to run the cron once(eventhough two node are preseent) in Web sphere server.

And what defects do you get when the job is run twice (other than duplicating the work done)?

The defect we got is it sends the same message twice to the queue.

Thanks...
Hi steve,

Thanks for your reply.

The method should not exceute paralley,you mentioned that. just prevent it from being executed twice at the same time.This condition we need .
If the method run twice seperately that's not the problem because we are checking the tables with key's.

Our code sending the message using JMS.When we start the server two methods are called paralley(due to two server nodes present in the server) and executed twice.

So why do you have two nodes running the cron job, why not just one?
we configured only once in our code.I am not aware of how to run the cron once(eventhough two node are preseent) in server.

And what defects do you get when the job is run twice (other than duplicating the work done)?
Hi,

In my program a cron job is runing for every five minutes and it calls a method to send an xml message.I am using Application server with two nodes.so when server starts two nodes are invoking the cron job simultaneously so my method is called twice and
i am getting some deffects.

1)Due to two server two times methods are called and two messages with same details sent,evethough I am checking my database properly the condition in my table.
2)Two different messages are appended and it is going as a single message.

I am going to use synchronized keyword to my method.That method will call other 3 methods.Do i need to use the synchronized keyword for other methods also?

By using synchronized keyword My issue will resolve?

Please give some suggestion.

Thanks
Hi,

I am using IBM websphere server6.0.2.17 and sonicMQ Messageing servie for JMS part.
I configured queues one is for getting the messeage and sending the message.I have configured my queues in Generic part in JMS provider and Lister port in server.
This request Queue I made a JNDI name in Generic part in JMS provider part and configured in Listener port with same JNDI name as jms/IdidRequestRef.
There are two servers in my APP severs.I configured ite listener port in two server nodes also.


Please give some solution.
I am getting exception like

WMSG0017E: Unable to lookup JMS resources, JNDI lookup exception: IDL m
g.org/CosNaming/NamingContext/NotFound:1.0
[10/2/08 3:35:50:578 CDT] 00000032 MDBListenerIm W WMSG0019E: Unable to start MDB Listener IdisMDB, JMSDestination jms/Idis
RequestRef : javax.naming.NameNotFoundException: Context: picsteaDEV/clusters/PIEDEVcluster, name: jms/IdisRequestRef: First
component in name IdisRequestRef not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/C
osNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:543)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2213)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:4043)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1746)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1707)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1412)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1290)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:145)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.ibm.ejs.jms.listener.MDBListenerImpl.createResources(MDBListenerImpl.java:234)
at com.ibm.ejs.jms.listener.MDBListenerImpl.internalStart(MDBListenerImpl.java:726)
at com.ibm.ejs.jms.listener.MDBListenerImpl.restart(MDBListenerImpl.java:699)
at com.ibm.ejs.jms.listener.MDBListenerImpl.alarm(MDBListenerImpl.java:1034)
at com.ibm.ejs.util.am._Alarm.run(_Alarm.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
---- Begin backtrace for Nested Throwables

13 years ago
Hi
I need to set the cron expression to run a method present in a Stateless bean for every 5 min.
Before i used servlet form there I called.
Now I need to do without using the servlet only ejb is there .There is no front end.It s a seperate process.
So, can you please help me in how to set the cron expression and it should start when the ejb.jar is installed.
Where I need to add the code

Thanks
A.Baljai.
Hi,

I am using Hibernate in our project.We are making the transcation by using Session s=getCurrentSession() and and the transcation is begin by using s.beginTranscation().Once the transcation is completed,we closing the transcation,but in many of the code session is not clossed.This is the process we are doing in many part of the code.
Now we are facing a big issue with oracle10g.
Oracle is showing that the sessions are not closed.
ba1231@pida4001> ps -ef |grep picte1d
oracle 200794 1 0 Sep 16 - 0:10 ora_dbw0_picte1d
oracle 266356 1 0 Sep 16 - 0:12 ora_smon_picte1d
oracle 458904 1 0 Sep 16 - 0:05 ora_mman_picte1d
oracle 495838 1 0 Sep 16 - 0:35 ora_pmon_picte1d
oracle 504062 1 0 Sep 16 - 0:16 ora_psp0_picte1d
oracle 508152 1 0 Sep 16 - 0:12 ora_lgwr_picte1d
oracle 512250 1 0 Sep 16 - 0:34 ora_ckpt_picte1d
oracle 516348 1 0 Sep 16 - 0:00 ora_reco_picte1d

The above shows that in a oracle instance these many sessions are still open.Actually what happend is it is e allowing the upto 100 sessions to open and once 99 session are opened and the oracle
Database itself locked we are not able to coonect the DB.

We need to clear why this is hapening? and where we need to check the code?

If you need any details let me know.
Waiting for the reply.
Hi

In my code in every method session is created by calling
Session session = HibernateUtil.getCurrentSession();
inside this method it is calling

Session s = null;
try{
s = sessionFactory.getCurrentSession();
}catch (Exception e){}

So i get session and doing some transaction and at last transaction is commited by calling commit method but session is not closed .
My questions are
So I need to close the session in every method?
If not either it will reflect in database telling that session are open?
So, please clear my doubts how to handle the session properly and most effeciently.

Thanks
waiting for the reply.
It is possible to check the transcation at the present coce itself?
Thanks
Is there is any logic I can add in existing code itself to avoid the exception.

Thanks.
Hi

When I am navigating from one JSP to another JSP page I am getting error like "Error clearing sessionflush is not valid without active transaction".

This is below code
public void clearHibernateSesion() throws Exception {
try{

HibernateUtil.closeSession();
} catch (Exception e) {
LOG.error(e.getMessage());
throw new ProcessException(LSConstants.OTHER_ERROR);
}
In this code how I have to modifiy to avoid the exception?

Please explain
Thanks.
Hi

I am using SonicMQ.I configured Sonic and i am trying to send a message to a destination.I am having one connection factory and two destinations ,I send a message.The message is picking by MDB Bean.The messages is processed while sending the response .I am getting the following exception.

RegisteredRes E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
[9/2/08 13:01:15:656 IST] 0000003f LocalTransact E J2CA0030E: Method enlist caught com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
at com.ibm.ws.Transaction.JTA.RegisteredResources.enlistResource(RegisteredResources.java:369)
at com.ibm.ws.Transaction.JTA.TransactionImpl.enlistResource(TransactionImpl.java:2970)
at com.ibm.ws.Transaction.JTA.TranManagerSet.enlistOnePhase(TranManagerSet.java:418)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:516)
at com.ibm.ejs.j2c.ConnectionEventListener.localTransactionStarted(ConnectionEventListener.java:56

Please provide some Solution.
Thanks.
Hi
I need to delete a list of records.I used the Query
String strQuery = "Select * from ORDER_EQUIPMENT_DETAIL where ORDER_ID= 1001 ";
query = HibernateUtil.createSQLQuery(strQuery);
List result = query.list();
Now I need to Delete the list.In This List it is having both OrderEquipmentDetailId.java and OrderEquipmentDetail.java records.While Iterating the records in the list I am confused,I need to typecast with
correct class or How to delete?
Please help.
Thanks.
Hi
I am using SONICMQ service for JMS,for this I need any documnet or pdf file to configure in server and to write the code and also to test that.I am using RAD.So can you please help me to configure and howe to test a sample text message.

Thanks.