Gupta Tarun

Greenhorn
+ Follow
since Sep 16, 2010
Gupta likes ...
Hibernate MyEclipse IDE Postgres Database
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
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gupta Tarun

How about doing a negative check on "_ and - cannot be consecutive" i.e. should not contain '__' and '_-' and '--' and '-_'.
7 years ago

I think you need to be more precise in asking this question - if I understood it correctly, there can be either of following two possibilities :

1. When an account object is created (or any other event happens ) on Server1 you want to notify server2 with that event and pass the data ?
2. Server1 and Server2 just want to share some Data, Assuming both the servers have the appropriate handle for that data (Identifier/primary key etc are available to both the servers.)

if Case 2 is correct then I think its simplest to share using the database/file.

If Case 1 is correct its slightly more work to be done, you will need to use messaging(JMS) or Remoting (EJB / RMI/ Webservices / plain socket communication) technologies depending on whether you want a push mechanism or pull mechanism. Simple File/DB polling is also an option. You should also consider the scenario the event is generated but receiver server is down.
7 years ago

Maneesh Godbole wrote:This forum is for portals and portlets. In case you haven't noticed, we have a dedicated forum for JBoss. I will move your post over there for you.
In future, please please do take out time to CarefullyChooseOneForum



Thanks! I realized it after submitting my post, And I was hoping that moderators will move it appropriately Thanks again !
7 years ago
Hi,

We are using JBoss version 5.1.0 GA on Windows 64 bit and CentOS environments. We are currently doing some Load and Performance testing. And monitoring the JVM using Java - VisualVM.
Something that is bothering us is - during the Load testing when we increase Load on the application, JBoss increases the number of threads. This done based on the Jboss HTTP ThreadPool Configuration (Max upto 200 threads for HTTP requests). But when the application load comes back to a normal state we notice that all the threads that where created by JBoss still remain in 'Waiting State' ever after. This happens in both the environments (Windows as well as CentOS).

So My Question is :
Is it wrong to expect that the number of JVM Threads should come down ? (Ideally in my opinion JBoss should kill some threads to free up the memory.)
If No then how do we configure the same.

Reasons Why we are bothered about this issue is that we are using ThreadLocal for passing some objects around different containers.

After some research the only relevant post that I could fond is following open issue in Jboss Bug Tracking System:Issue
Based on this, should I assume that This issue is the known bug in JBoss and we have to live with this util they fix this bug.

Thanks and Regards
Tarun


7 years ago
Please check if something like Terracotta (http://www.terracotta.org) solves your problem

Regards
Tarun
8 years ago
I thought the approach you mentioned should work so to check this I created following 2 classes :





And it seems to give me a the correct output which is :


Sub Class blah
Base Class blah


I still didn't get where the issue is..

Regards,
Tarun


1. One option is to package the configuration file and load it from class path as explained here,
http://www.javaworld.com/javaqa/2003-08/01-qa-0808-property.html the only drawback here is that any changes in the configuration file requires re-packaging the application.

2. To avoid that you can have System property which can be specified using -D option, but this becomes an addition installation/deployment step.

If you don't like 1 and 2 then you can still use web.xml init-param and get the handle of the servlet context using following code within your axis2 service -



Regards
Tarun
8 years ago

For better understanding you can include some code snippet in your post.
I think if you are calling query.list() or query.iterate() as mentioned in http://www.roseindia.net/hibernate/hibernateorderbyexample.shtml then what you will get will be an object of the class that have run your query on. (if your query is "from Cat as cat" then you should expect objects of class "Cat") So in your case you should typecast your objects to appropriate class and then you should get firstname and lastname.


We are implementing Spring Security based declarative permission checks in our Axis2 web services.. which looks something like this :



Here are some references :
http://burtbeckwith.github.com/grails-spring-security-acl/docs/manual/guide/2.%20Usage.html
http://blog.springsource.com/2009/06/03/spring-security-300m1-released/

Will be happy to help in case you need further information.

Regards
Tarun
8 years ago
Hi Sriram,

I think when we talk about efficiency we need to consider Space-time tradeoff.

So I think in this case if time is your criteria and not the space, then sorting the entire array is not a good idea, alternative can be using HashSet. add() and check the returned boolean value, if its false the value that you are adding already exists in the set hence its a duplicate number, Time wise it be more efficient then sorting the entire array but consume more memory space.

Regards
Tarun
8 years ago

Wouter Oet wrote:Yea I know and usually I only give abstract answers but his time it was nice to think back to my data-structure lessons and prove to myself that I still got it



data-structure ? or you mean "Flow control"
8 years ago

Campbell Ritchie wrote:Good grief. What a dreadful solution.



I Agree. I think its was an overkill if you just need the highest frequency, but okay if you need all the frequencies in descending order.
Good to know about the rules with respect to the posts getting deleted.. as I am new here.

Thanks,
8 years ago
If Performance is not a concern the following code should work..



Please refer to following interesting thread to understand sorting part...Sorting Tree by Value and not key

8 years ago
Okay,
Let me try to put my scenario in very few words :

Using Axis2 Stateful Services what is the best way to store the client state inside the caller applications HTTP Session, Axis2 Engine and Web Application both are running on clustered environment.
8 years ago
Compare the output of following two statement :




Then read a little about String literal and String literal Pool.
here

I am almost sure you will get a good insight of why it is so.

Regards
Tarun
8 years ago