vishwa venkat

Ranch Hand
+ Follow
since Nov 22, 2003
Merit badge: grant badges
For More
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 vishwa venkat

Here is more info-

First i go to list screen where I display all employees foa department using-

Query query = currentSession.createQuery("from Employee v where v.deptId=" + deptId);
List<Employee> retList = query.list();

Next I go to particular employee by another query-
Query query = currentSession.createQuery("from Employee v where v.empId=" + empId);
Employee v = (Employee ) query.uniqueResult();

and once the user makes changes to the employee I call update-

Employee v = (Employee ) currentSession.merge(employee);

and then I go back to view the list of employees again-

Query query = currentSession.createQuery("from Employee v where v.deptId=" + deptId);
List<Employee> retList = query.list();

I keep refreshing the list screen sometimes I see the employee with old details sometimes with new details.

I used a HibernateSessionFilter that starts up a session on each servlet request and closes at the end of service the request.

let me know if you need any more details.. I am very confused why its behaving weird...Thanks for all your help!
I have not set any second level cache.

I am just doing-

Query query = currentSession.createQuery("from Employee v where v.empId=" + empid);

List<Employee> retList = query.list();

and what I was doing is updating one of the employee object. and when I execute the query sometimes it returns update employee in the collection and sometimes old employee in that collection.

can some one help? Thanks,
Start with Struts Framework. and make sure you have all your database access code in DAO's exposed by interfaces. Make sure everything working fine with JDBC DAOs. and then slowly include Hibernate stuff ..hibernate.cfg.xml and mappings, HibernateUtil,..and write new implementation of DAOs using Hibernate. This will give you a chance to see how Hibernate eases development over JDBC.
Once you are experienced, you can write Hibernate code directly instead JDBC.
14 years ago
Verify what version of struts you are using 1.1. or 1.2 or 1.3.

Unzip/Unjar struts.jar and check the MANIFEST.MF in META-INF.

and make sure you have correct DTD specifier in your struts.xml
14 years ago
you should use select in this fashion-

<s:select list="couList" listKey="couid" listValue="couName" headerKey="-1" headerValue="-Select-" onchange="countrychange()"></s:select>
assuming couList is a list of Country Object having couid,couName as properties.
14 years ago
look for ant filter config for hibernate config. by which you can pass the parameters to hibernate config from ant build target.
did you try setting show_sql property in hibernate config and able to see the sql that it generated?
Did you try passing the id of the record in modify/delete links.
14 years ago
session is treated as a Map in struts2, so use the following to get it -

<s:property value="%{session['emailId']}"/>
14 years ago
Thanks for the reply.

I got cglib and asm in my classpath and here is the snippet from applicationContext.xml

<!-- A simple MethodInterceptor style advice object (InterceptorA implements MethodInterceptor) -->
<bean id="loggingAspect" class="aspects.LoggingAspect"/>

<bean name="pointcut.advisor2" class="">
<property name="advice" ref="loggingAspect"/>
<property name="mappedName" value="*"/>

<!-- Create the proxy bean that returns AOP'd varieties of our controller -->
<bean name="myController" class="org.springframework.aop.framework.ProxyFactoryBean">

<property name="target" ref="claimService" />
<property name="interceptorNames">


After all this, I don't see any error, but also I don't see any thing happening.Aspect is not being executed.

Do you have a sample? Thanks-
14 years ago
Is this possible?

I have tried several ways to integrate spring AOP with Struts2, with no luck. AutoProxy doesn't seem work well too. Can you guys suggest some ideas?


14 years ago
Before forwarding to this page, make sure the countryList object is initialized. atleast assign an empty arraylist object. Struts2 expects to have the list being initilized in the input action class.
14 years ago
can't you use javascript DOM to populate the table with the values entered in modal popup.
14 years ago