Re: [JBoss-user] Strange Problem on Linux
I think there is a very simple solution to this which is much safer. Instead of triggering threads off in your class, move the thread body into a MDB and then simply send several messages from your session bean. The MDB will enable your code to run asynchronously which is probably the effect you are trying to achieve. On Tue, 2002-10-15 at 13:46, rahul ganjoo wrote: Guys any help with this would be much appreciated. I am repeating the scenario here: Environment: Jboss 3.0.3 ,Red hat Linux 7.2 A session bean invokes a java class and then another class which triggers off threads to do some db updations etc. However we find we can get the results just one time but the second time it hangs giving the trace below (Saroj's mail). However it runs fine on Win2k with same JB config. Even if we change those db updations to just SOPs, it still hangs the second time around. -- Peter Beck BEng (hons) - Managing Director, Electrostrata Ltd. http://www.electrostrata.com --+-+-- Experts in e-business and e-commerce --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
Hi Pete! What was being acheived using threads obviously was some parallelism...as in we wanted some actions to be executed simulataneously. Now I have not worked with MDBs,JMS etc yet. Are you suggesting using MDBs its possible to acheive the same and avoid violating the spec? Any ellaboration is welcome. Thanks and Regards, Rahul Ganjoo. Pete Beck wrote: I think there is a very simple solution to this which is much safer. Instead of triggering threads off in your class, move the thread body into a MDB and then simply send several messages from your session bean. The MDB will enable your code to run asynchronously which is probably the effect you are trying to achieve. On Tue, 2002-10-15 at 13:46, rahul ganjoo wrote: Guys any help with this would be much appreciated. I am repeating the scenario here: Environment: Jboss 3.0.3 ,Red hat Linux 7.2 A session bean invokes a java class and then another class which triggers off threads to do some db updations etc. However we find we can get the results just one time but the second time it hangs giving the trace below (Saroj's mail). However it runs fine on Win2k with same JB config. Even if we change those db updations to just SOPs, it still hangs the second time around. -- Peter Beck BEng (hons) - Managing Director, Electrostrata Ltd. http://www.electrostrata.com --+-+-- Experts in e-business and e-commerce --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user -- -- Outside of a dog, a book is man's best friend; inside of a dog, its too dark to read. Rahul Ganjoo Software Engineer Corporate Business Solutions Domain Wipro Technologies Bangalore. Tel. 5502001 ext 2022 9845136660 -- --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
I'm not entirely sure how this would be handled in JBoss, but in principle you could send out a bunch of JMS messages to a topic or queue. The EJB container then launches threads to process the messages through MDB instances. Therefore potentially, your code will be executed in parallel. Of course, you cannot guarantee when the message will get processed, but usually it is straight away. If your threads *must* execute simultaneously, then MDB might not be able to help you. I use MDB's to handle time-consuming activities in the background so that my session beans do not have to wait for the processing to finish. Whether it will help you depends on how strictly you need to control the threads. In my case the parallelism is a benefit not a requirement. On Thu, 2002-10-17 at 09:20, rahul ganjoo wrote: Hi Pete! What was being acheived using threads obviously was some parallelism...as in we wanted some actions to be executed simulataneously. Now I have not worked with MDBs,JMS etc yet. Are you suggesting using MDBs its possible to acheive the same and avoid violating the spec? Any ellaboration is welcome. Thanks and Regards, Rahul Ganjoo. -- Peter Beck BEng (hons) - Managing Director, Electrostrata Ltd. http://www.electrostrata.com --+-+-- Experts in e-business and e-commerce --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
In our case the parallelism is a requirement. We wait for threads to return and then proceed. So ideally we would want to send messages to a q where they get consumed simultaneously. Pete Beck wrote: I'm not entirely sure how this would be handled in JBoss, but in principle you could send out a bunch of JMS messages to a topic or queue. The EJB container then launches threads to process the messages through MDB instances. Therefore potentially, your code will be executed in parallel. Of course, you cannot guarantee when the message will get processed, but usually it is straight away. If your threads *must* execute simultaneously, then MDB might not be able to help you. I use MDB's to handle time-consuming activities in the background so that my session beans do not have to wait for the processing to finish. Whether it will help you depends on how strictly you need to control the threads. In my case the parallelism is a benefit not a requirement. On Thu, 2002-10-17 at 09:20, rahul ganjoo wrote: Hi Pete! What was being acheived using threads obviously was some parallelism...as in we wanted some actions to be executed simulataneously. Now I have not worked with MDBs,JMS etc yet. Are you suggesting using MDBs its possible to acheive the same and avoid violating the spec? Any ellaboration is welcome. Thanks and Regards, Rahul Ganjoo. -- Peter Beck BEng (hons) - Managing Director, Electrostrata Ltd. http://www.electrostrata.com --+-+-- Experts in e-business and e-commerce --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user -- -- Outside of a dog, a book is man's best friend; inside of a dog, its too dark to read. Rahul Ganjoo Software Engineer Corporate Business Solutions Domain Wipro Technologies Bangalore. Tel. 5502001 ext 2022 9845136660 -- --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange Problem on Linux
rahul ganjoo wrote: Yes Ofcourse the EJB spec doesnt recommend threading in EJBs... Section 24.1.2 of the EJB 2.0 spec says: An enterprise Bean must not use thread synchronization primitives to synchronize execution of multiple instances. --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange Problem on Linux
rahul ganjoo wrote: Yes Ofcourse the EJB spec doesnt recommend threading in EJBs... It specifically *prohibits* threading. Section 24.1.2 of the EJB 2.0 spec says: The enterprise bean must not attempt to manage threads. The enterprise bean must not attempt to start, stop, suspend, or resume a thread; or to change a thread's priority or name. The enterprise bean must not attempt to manage thread groups. Benjamin --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange Problem on Linux
Hi All, This problem is resolved now. We had a while loop which was checking for some boolean value. This boolean Was updated by worker threads. This update is done in a synchronized method call by worker threads. On Windows, There is no problem. But, On Linux and Solaris, it creates a deadlock. It is resolved by making the main thread sleep for some time. Now, it works fine on Win2k, Solaris and Linux. I am looking forward to some good design practices on Worker Thread examples. TIA, Saroj -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Marius Kotsbak Sent: Saturday, October 12, 2002 3:00 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Strange Problem on Linux saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: RE: [JBoss-user] Strange Problem on Linux
Thanks Dude,I appreciate the help.. funnily enough we got it to work somehow though the design needs to change... - Original Message - From: Geer, Benjamin [EMAIL PROTECTED] Date: Wednesday, October 16, 2002 2:53 pm Subject: RE: [JBoss-user] Strange Problem on Linux rahul ganjoo wrote: Yes Ofcourse the EJB spec doesnt recommend threading in EJBs... Section 24.1.2 of the EJB 2.0 spec says: An enterprise Bean must not use thread synchronization primitives to synchronize execution of multiple instances. --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http: http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
One design is to use mbeans which trigger message driven beans through jms Regards, Michael saroj kumar wrote: Hi All, This problem is resolved now. We had a while loop which was checking for some boolean value. This boolean Was updated by worker threads. This update is done in a synchronized method call by worker threads. On Windows, There is no problem. But, On Linux and Solaris, it creates a deadlock. It is resolved by making the main thread sleep for some time. Now, it works fine on Win2k, Solaris and Linux. I am looking forward to some good design practices on Worker Thread examples. TIA, Saroj -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Marius Kotsbak Sent: Saturday, October 12, 2002 3:00 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Strange Problem on Linux saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
(a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked 0x44afa8e0 (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) Reference Handler daemon prio=1 tid=0x0x80b1748 nid=0x5cf waiting on monitor [4c4c1000..4c4c186c] at java.lang.Object.wait(Native Method) - waiting on 0x44afa740 (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:426) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113) - locked 0x44afa740 (a java.lang.ref.Reference$Lock) VM Thread prio=1 tid=0x0x80aedd0 nid=0x5ce runnable VM Periodic Task Thread prio=1 tid=0x0x80b73e0 nid=0x5d1 waiting on monitor Suspend Checker Thread prio=1 tid=0x0x80b7e48 nid=0x5d2 runnable -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bill Burke Sent: Sunday, October 13, 2002 7:44 AM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] Strange Problem on Linux you can generate threads anytime within a JBoss application. Just remember, you lose any transaction or security context when you spawn the thread. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Marius Kotsbak Sent: Friday, October 11, 2002 5:30 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Strange Problem on Linux saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user -- -- Outside of a dog, a book is man's best friend; inside of a dog, its too dark to read. Rahul Ganjoo Software Engineer Corporate Business Solutions Domain Wipro Technologies Bangalore. Tel. 5502001 ext 2022 9845136660 -- --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
Hi Jonathan, Yes Ofcourse the EJB spec doesnt recommend threading in EJBs... but someone here thought providing two levels of indirection from the EJB component would make sure it executes outside the context of the bean which apparently aint the case. However I am curious why it aint causing us trouble on win2k boxes??? Is there any workaround to this on Linux till we get the design right? TIA, Rahul Ganjoo. Jonathan.O'[EMAIL PROTECTED] wrote: Rahul, I thought the EJB spec doesn't allow code to start threads. You should probably send an update message to a queue and do the DB updates there. Ciao, Jonathan O'Connor Ph: +353 1 872 3305 Mob: +353 86 824 9736 Fax: +353 1 873 3612 rahul ganjoo [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 15.10.2002 13:46 Please respond to jboss-user To: [EMAIL PROTECTED] cc: Subject:Re: [JBoss-user] Strange Problem on Linux Guys any help with this would be much appreciated. I am repeating the scenario here: Environment: Jboss 3.0.3 ,Red hat Linux 7.2 A session bean invokes a java class and then another class which triggers off threads to do some db updations etc. However we find we can get the results just one time but the second time it hangs giving the trace below (Saroj's mail). However it runs fine on Win2k with same JB config. Even if we change those db updations to just SOPs, it still hangs the second time around. TIA, Rahul Ganjoo. saroj kumar wrote: Hi All, This is the full thread dump which I get. Can Anybody help me understand this dump?? Full thread dump Java HotSpot(TM) Server VM (1.4.0_01-b03 mixed mode): JNP Server prio=1 tid=0x0x877e2c8 nid=0x67d runnable [5060b000..5060b86c] at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343) - locked 0x44cfc438 (a java.net.PlainSocketImpl) at java.net.ServerSocket.implAccept(ServerSocket.java:438) at java.net.ServerSocket.accept(ServerSocket.java:409) at org.jnp.server.Main.run(Main.java:248) at java.lang.Thread.run(Thread.java:536) Thread-25 daemon prio=1 tid=0x0x4e93cbd8 nid=0x679 waiting on monitor [5058a000..5058a86c] at java.lang.Object.wait(Native Method) - waiting on 0x45ba1648 (a [Lcom.wipro.flowbrix.logger.LogQueue$InternalLogQueue;) at java.lang.Object.wait(Object.java:426) at com.wipro.flowbrix.logger.LogQueue.put(LogQueue.java:115) - locked 0x45ba1648 (a [Lcom.wipro.flowbrix.logger.LogQueue$InternalLogQueue;) at com.wipro.flowbrix.logger.LogQueue.get(LogQueue.java:255) at com.wipro.flowbrix.logger.LogWriter.run(LogWriter.java:147) RMI TCP Connection(20)-192.168.146.24 daemon prio=1 tid=0x0x85663c8 nid=0x65c runnable [50282000..5028486c] at com.wipro.flowbrix.workflow.WFActivityController.execute(WFActivityContr oller.java:151) at com.wipro.flowbrix.workflow.WFActivityHandler.handleActivity(WFActivityH andler.java:161) at com.wipro.flowbrix.workflow.sb_processmanager.ProcessManagerBean.execute Activities(Unknown Source) at com.wipro.flowbrix.workflow.sb_processmanager.ProcessManagerBean.doProce ss(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stat elessSessionContainer.java:660) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke( CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Statele ssSessionInstanceInterceptor.java:77) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce ptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor CMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav a:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer .java:313) at org.jboss.ejb.Container.invoke(Container.java:712) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:1 02
RE: [JBoss-user] Strange Problem on Linux
PROTECTED] Subject: RE: [JBoss-user] Strange Problem on Linux you can generate threads anytime within a JBoss application. Just remember, you lose any transaction or security context when you spawn the thread. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Marius Kotsbak Sent: Friday, October 11, 2002 5:30 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Strange Problem on Linux saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
Hello saroj, it can be a locking problem. Is there a chance the second call spawns a thread that calls entity bean that is currently involved in the transaction initiated by the first call? Why it doesn't happen on windows?.. Probably, on windows the transaction needs less time to complete. May it take place? alex Friday, October 11, 2002, 9:50:27 PM, you wrote: sk HI All, sk I am facing Transaction Timeout exception while running sk the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. sk Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. sk Scenario is: sk UI Layer makes a call to SLSB. This SLSB makes a call to another sk SLSB which uses a class. This class spawns two threads sk And one of these threads operates on Entity Bean using a Session Bean. sk When we make 1st call, it works fine but 2nd time onwards same call sk fails with Exception TX marked for rollback. Possibly timeout. sk Any help would be more than welcome. sk TIA, sk Saroj -- Best regards, Alex Loubyansky --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange Problem on Linux
you can generate threads anytime within a JBoss application. Just remember, you lose any transaction or security context when you spawn the thread. -Original Message- From: [EMAIL PROTECTED] [mailto:jboss-user-admin;lists.sourceforge.net]On Behalf Of Marius Kotsbak Sent: Friday, October 11, 2002 5:30 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Strange Problem on Linux saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange Problem on Linux
saroj kumar wrote: HI All, I am facing Transaction Timeout exception while running the code on Redhat Linux 7.3/JDK1.4/JBOSS 3.0.3/Oracle9i. Same code is working fine on Win2k/JBOSS 3.0.3/jdk1.4/Oracle9i. Scenario is: UI Layer makes a call to SLSB. This SLSB makes a call to another SLSB which uses a class. This class spawns two threads And one of these threads operates on Entity Bean using a Session Bean. When we make 1st call, it works fine but 2nd time onwards same call fails with Exception TX marked for rollback. Possibly timeout. We actually get this too on linux, but probably because of a long transaction. But I think you arn't allowed to create any threads in jboss. Any help would be more than welcome. TIA, Saroj --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange problem
Hi, This could be due to the fact that you are trying to store and read all in one transaction, if the transaction isn't committed, the row is not yet inserted in the database. Joost. -Original Message- From: Mahesh Agarwal [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 6:55 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] Strange problem Hi Everybody I am facing a very strange problem in my application which is running in Jboss. I am creating a Request in my application and saving that Request in the database(MySql), that mean, I inserted a new row in a table. When I come to my application again to see that Request , the application says that unable to find the request. Strange!! But when I tried for next time, the application shows the Request without any exception. This problem is not repeatable but occurs very frequently. Please give me some suggestion regarding this error. Thanks a lot in advance Mahesh ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange problem
Hi, Here is log for which the error is coming. [snip] [2002-04-09 10:32:07,587; JAWSPersistenceManager]Thread-64 java.sql.SQLException: Lost connection to server during query (I think, here is the problem) [2002-04-09 10:32:07,596; JAWSPersistenceManager]Thread-64 java.sql.SQLException: Lost connection to server during query [2002-04-09 10:32:07,596; PurchaseOrderManagerSB]Thread-64 FinderException: javax.ejb.FinderException: Find failed, msg=java.sql.SQLException: Lost connection to server during query [snip] Well, from that, it looks like your comment is accurate. I have no experience with MySQL, but a connection being dropped would be likely to cause the problem. Perhaps someone with more experience in MySQL can offer advice on what might be causing the connection to be dropped. cheers dim ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Strange problem
If you could post a stack trace it would help. cheers dim - Original Message - From: Mahesh Agarwal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 08, 2002 2:54 PM Subject: [JBoss-user] Strange problem Hi Everybody I am facing a very strange problem in my application which is running in Jboss. I am creating a Request in my application and saving that Request in the database(MySql), that mean, I inserted a new row in a table. When I come to my application again to see that Request , the application says that unable to find the request. Strange!! But when I tried for next time, the application shows the Request without any exception. This problem is not repeatable but occurs very frequently. Please give me some suggestion regarding this error. Thanks a lot in advance Mahesh ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange problem with BMP entity bean caching - incorrect values found by findByPrimaryKey()
Title: RE: [JBoss-user] Strange problem with BMP entity bean caching - incorrect values found by findByPrimaryKey() What is the transaction setting of ur bean and modifyDetails()? are u sure that they are at 'Required'? -Original Message- From: Adam Lipscombe [mailto:[EMAIL PROTECTED]] Sent: Monday, September 17, 2001 9:58 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] Strange problem with BMP entity bean caching - incorrect values found by findByPrimaryKey() Folks, JBoss 2.4.0 with Tomcat 3.2.3 - I have a strange problem that has completely foxed me: The sequence of events on a BMP entity bean is as follows. All steps are called from a client in separate transactions: 1. Bean Created 2. Bean Read State OK at this point 3. Bean Updated State written to DB OK, beans internal value object is updated OK. 4. Bean Read. State retrieved is state *before* update in step 3. 5 Bean Updated 6. Bean Read The problem is that the read at (4) retrieves the bean state that was present *before* the update at (3) was processed. I have checked the database and the update in (3) does get written to the DB. I have debugged the code and the ejbStore() and ejbLoad() methods get called as expected. As far as I can see, the cached bean does not accurately reflect the contents of the DB. Its almost as if findByPrimaryKey() is getting the wrong bean instance from the cache. I am using commit-option A as JBoss is only thing talking to the DB. The code that updates the bean is as follows: (Note details is a ContactModel value object instance) -- // Find Contact instance first in case it does not exist ContactKey primaryKey = details.getContactPrimaryKey(); Contact contact = contactHome.findByPrimaryKey(primaryKey); // Modify Bean and re-read in case DB has massaged the data contact.modifyDetails(details); contact = contactHome.findByPrimaryKey(primaryKey); ContactModel updatedDetails = contact.getDetails(); --- and the ejbStore method looks like: (contactDetails is the beans internal value object holding the bean state) - try { setDAO(); this.contactDetails = (ContactModel) contactDao.update(this.contactDetails); modified = false; logger.info(contact bean stored, contactDetails = + this.contactDetails); } catch (DAOFinderException ex) { context.setRollbackOnly(); throw new NoSuchEntityException(ex.getMessage()); } catch (DAOApplicationException ex) { context.setRollbackOnly(); throw new EJBException(ex.getMessage()); } catch (DAOSystemException ex) { context.setRollbackOnly(); throw new EJBException(ex.getMessage()); } Does anyone have any ideas? I am completely stumped... Thanks in advance - Adam ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user