Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

lokesh sree

Ranch Hand
+ Follow
since Oct 27, 2009
lokesh likes ...
Eclipse IDE Hibernate Java
Bangalore, India
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by lokesh sree

If you want to learn the concepts and practice examples related to that, books are a good source and Winston has already pointed you to the best book on java.
But if you want to just try some additional examples or small programming puzzles online itself, there are a good amount of such sites. And, I found really useful for beginners.
Hope this helps.
3 years ago
In that case, the only reason i can think of is - The Selector class is inside the scope of transaction. So, when you are trying to lazily fetch the data, it would work fine. But, when you go to the builder class, the transaction would scope would have ended, the hibernate session gets closed. So, if you now try accessing the data which is supposed to be fetched lazily, it will not work.
I am not much aware of hibernate session internals. So, I cannot provide more inputs here.
4 years ago
Just a random thought.. I believe you might be doing all this data fetch inside a transaction. In that case, it's working looking at it from a transaction time-out perspective as well. By default, the Transactions have a 5min timeout values. You can try increasing the timeout values and verify your large data loads.
4 years ago
A quick look at the javadocs for the library seems to say that there is an alternative method optString() which you can use. You can look at

Hope that helps.
4 years ago
I hope the deployment structure(war, ear, ejb etc.) is proper as per the example you are following and the ear is named "TestEJB".
If jmx-console is not working, then its worth checking if JBoss is started and running fine or not..

If I am not wrong, either changing the name="TestSession" to name="TestSessionBean"
Or changing the lookup string "TestEJB/TestSessionBean/local" to "TestEJB/TestSession/local"
should get this working.

And, if it still doesn't work, do have a look at the jndi view of the JBoss after the bean is deployed.
Posting code snippets of your interface, session bean etc. with the annotations used will give more clarity on what's being done.
And, an additional help tip. If you want to actually check whether your session bean is deployed fine and the binding has happening as you excepted or not, you can look at the JNDI tree of the JBoss from its jmx-console. You can search for details on how to get there
Looks like similar discussions have already happened on this forum itself.. for example this thread
Hope these might help.
4 years ago

Definitely "Effective Java" is a must read for any experienced programmer.
And, in case if you have not yet looked at, you can look at the bunkhouse for a detailed review of books on all topics.
4 years ago

Ok, when I said hashCode will be unique, I was only talking about the implementation of the java's Object class. To quote, from the javadocs

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects.

I will redirect the OP to the javadoc for more clarity..
4 years ago

can it be possible ,two different object have same hashcode?

Depends on which object you are talking about and what is the implementation of hashcode() method for that object.

as i know hashCode is unique no which is generated by jvm during object creation based on the address of an object to provide uniqueness.

Yes, that's correct. But that is about the jvm implementation for the java's Object class. It can always be overriden and its upto the overriding class to make sure that its implementation is unique. Look at the jdk code of java's String class to see one such override. And, yes , you can always just do a "return 1" in the overriden hashcode() method in your class. But that violates the basic principle of having a unique hashcode to differentiate between objects. Hope this clarifies.

4 years ago
Hi Ola and Daniel,

Good to see a book on a systematic approach to do code re-factoring, which I believe is a major activity happening now a days in software.

The quick introduction and the book's content seems to talk about dealing and improving legacy code. So, My question here is - Is this approach or method completely dedicated to re-factoring alone?
Or, are there parts of the approach that can be applied to new code development as well?

Thanks and Best Wishes for the Book,
If you want to initialize the ArrayList with all the arrays at the time of creating the list itself, then you can do it in the following way:

But if you want to keep adding to the list, you have to call the add with the new array intArrList.add(new int[] {7,8,9});
5 years ago
ok.. I should have searched before i asked The lack of these buttons was clearly discussed here
5 years ago
Hi All,

I congratulate the java ranch team for all the good effort being put into the new look.
And, I just had a small thought which I wanted to communicate. Wouldnt it be be nice to add Previous, Next buttons in the Topic page.
So, we can open the first/recent topic in a forum and just keeping reading all the topics in that forum by going to older topics using the previous button.

5 years ago