Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

naresh voota

Greenhorn
+ Follow
since Jun 04, 2007
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 naresh voota

Shehroze,

Lazy intialization exception happens because hibernate does not support initialization of detached objects. I do not see any other reason. Are you sure the hibernate session which created the parent object is not closed? Even if you have a new session open, unless you merge the objects created in older sessions they will still give you Lazy initialization exception.

lazy="false" is not recommended unless there is an explicit reason to use it. lazy will fetch all the objects in the collection and you might not even use them. Getting the objects when you need them is better than loading on initialization. You might find the below documentation helpful.

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html

Regards,
Naresh Voota.
Shehroze,

Lazy initialization exception occurs because the hibernate session is closed. If you are getting an exception on Class, you must have a collection specified in the hbm with lazy="true"

Regards,
Naresh Voota.
HttpServletReponse --- It is a spelling mistake


The name of the class is HttpServletResponse

Thanks,
Naresh Voota
9 years ago
StringTokenizer is faster than String.split() but does not offer functionality like splitting basing on regex expression. But when you look at real world applications, the speed offered by StringTokenizer compared to String.split does not matter much. Sun is keeping StringTokenizer as it is used in legacy applications and for backward compatibility. Hence the advice to switch to String.split for newer code. While the case of String and Scanner is different. It is more of a case of different horses for different courses.
9 years ago
String Tokenizer does not accept(correction) regular expressions but split does. I believe that is why it is not encouraged these days.
9 years ago
Kedarinadh,

If your question is, can you split a text basing on some delimiter? yes you can.

All you need to do is read the file and split the text basing on a separator. The below link is useful.

http://www.javapractices.com/topic/TopicAction.do?Id=42

Thanks,
Naresh Voota.
9 years ago
Try Using scope="prototype" if you do not want any object not to be singleton. It is same as singleton = "false"

If you want singleton="true", you do not need to do anything on the bean. The behavior is default.

The latest versions of Spring identify scope.

Hopefully this helps.


putting long in int will reduce the precision of the value stored.

long l = 9;
String s= Long.toString(l);
byte[] b = s.getBytes();

once you pass this byte array over network,

String s = new String(b);
Long l = Long.valueOf(s);

hopefully this will help. Thanks.
9 years ago
putting long in int will reduce the precision of the value stored.

long l = 9;
String s= Long.toString(l);
byte[] b = s.getBytes();

hopefully this will help. Thanks.
9 years ago