Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Krishnaa Kumar

+ Follow
since May 05, 2011
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 Krishnaa Kumar

Thanks for reply.

In the following post it says, if we access an entity in non-transactional way, we need to enable auto-commit in hibernate configuration.
If not, once we close the session (we used for retrieving the entity) the database connection returning to the pool will have some issues/memory leaks.

lines in this link "the connection is in whatever mode it is by default after obtained from the pool, and returned there without commit or rollback. The behavior is then undefined."

kindly make me clear here.
What happens if I load an entity saying session.load() and close the session without beginning a transaction & comitting it
I gone through various sites, but couldn't find any good explanation.

If any Transient object was added into hibernate session, why can't hibernate persist it(after its dirty checking) when i close the session. Is there any such of kind of option available.
Also, if such option exists, then why we are beginning a transaction & saying it to commit. (session.beginTransaction() )

what functionality that transaction.commit() does can also be done once we say session.close() right?
Kindly any one explain me about this.

thanks in advance.
I Have a table(student) with columns stu_id, stu_name, favourite_subject, subject_id

favourite_subject will have predefined values like maths,english etc. if the value is maths, subject_id will have table: maths_subject's id.

meaning, based on favourite_subject value, subject_id will be pointing to the corresponding subject's id.

How can i implement in Hibernate ORM Framework.

all subjects will have their own tables & own corresponding entity classes.
I have many concurrent running http request serving threads. They will be creating an Object(? extends Object) for every request and save the object in a list.
Advice me some good data structure to implement this list.
I can't use ArrayList since it was not thread safe.
I dont like to use Vector - since its synchronized, it will make other threads to wait when one of the http thread was saving the object.
Also tried LinkedList, but there is data loss due to concurrent update.

I have variable that gets updated by different threads simultaneously. I don't want to control the simultaneous update through synchronization. Instead, i need to know how many threads updated the variable value simultaneously. I should not use synchronization concept as it will increase the serving time of those threads by waiting to get object lock released. How can i achieve this in Java.

I came across some issues using lazy instantiated singleton pattern


Similarly is there any issues in using early instantiated singleton pattern?
8 years ago
I Have a store and there exists many objects. Periodically i need to clean the store by dispatching the objects in it to another store.
When Iam cleaning the store, some of its object might be already in use (Other threads might be using the object to update its values).
I Can't wait until the other thread release the reference since, its a continuous process. So, some other object might now get Already in Use stage.
I cant't make the Store synchronized since threads creating new objects should not made to wait.

I need some design ideas to achieve proper cleaning of store.

I have created an object with global scope.

At some point I am in a different thread and need to know weather the global object is currently locked by any threads.

- Krishna
8 years ago

Basically we make methods synchronized to avoid concurrent update of a value in the method definition.
Thus the updated value by one thread is radiated to all threads.

But, in ThreadLocal concept, each thread has its individual independent value.
At any point of time no two threads access a same threadLocal value. then why to make initialValue method synchronized?

8 years ago

I came across a code where the get() and initialValue() methods of ThreadLocal is synchronized.

I couldn't find any use of having these methods synchronized. Correct me if I am wrong.

8 years ago

Is there any free hibernate, struts web hosting available.
If not, kindly help me with some good web hosting that supports my framework.

With Thanks,

I have a properties file filled up with comments about the key value pair, followed by key value pair.
If, i edit the some key values and save the file, all my comments are lost.
Is there any way to save the new key values with original comments.

9 years ago
Hi Deepak,

I looked into many "wsadmin programming classes" using decompiler. nothing seems to have http port settings.
Do you know any class that holds this information. if so, just share. it will be very much helpful for me.

With thanks, Krishna.
9 years ago
Hi deepak,

I want to find the http listen port, using reflection when the class(which holds port configuration) loads by class loader.

- With Thanks, Krishna.
9 years ago