Hi,
As i have posted earlier, I am trying to insert a record into DB and insert a record in the Repository.

While saving the information into the Repository i am not calling Session.save().
Scenario 1 : If i call session.save() method, then i am getting a problem that the created node is not rolling back.

Scenario 2: If i don't call session.save, then in the same request when i put a save, and retrieve the values from repository, i am able to see all the nodes, but when i give a new request to retrieve all the nodes from the repository, then the created repository node is not coming , so that means the node itself has not been created.

What could be the reason for this and how to get a solution for my problem ?


Code:
 
public void save(final Course course)throws DataAccessException
    {
    	log.info("Save Method");
    	getJcrTemplate().execute(new JcrCallback() {
    	      public Object doInJcr(Session session) throws RepositoryException {
    	        session = session.getRepository().login(new SimpleCredentials("admin", "admin".toCharArray()));
    	        System.out.println("Logged in UserName " + session.getUserID());
    	        System.out.println("Logged in Worksapce " + session.getWorkspace().getName());
    	        Node root = session.getRootNode();
    	        log.info("starting from root node " + root);
    	        Node sample = root.addNode( course.getName() ,"nt:unstructured");
                sample.setProperty( "id", course.getId().toString() );
                sample.setProperty( "code", course.getCode() );
                sample.setProperty( "description", course.getDescription() );
                sample.setProperty( "displaytoc", course.getDisplaytoc() );
    	        log.info("saved property " + sample);
    	        //session.save();
    	        return null;
    	      }
    	    });
    }
<bean id="connectionTracker" class="org.apache.geronimo.connector.outbound.conn ectiontracking.ConnectionTrackingCoordinator" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="transactionManagerImpl" class="org.jencks.factory.TransactionManagerFactor yBean" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="defaultTransactionTimeoutSeconds">
<value>600</value>
</property>
<property name="transactionLog">
<bean class="org.apache.geronimo.transaction.log.Unrecov erableLog" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
</property>
</bean>
<bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManage rFactoryBean" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="transactionManager">
<ref local="transactionManagerImpl" />
</property>
</bean>
<bean id="userTransaction" class="org.jencks.factory.UserTransactionFactoryBe an" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="transactionContextManager">
<ref local="transactionContextManager" />
</property>
<property name="connectionTrackingCoordinator">
<ref local="connectionTracker" />
</property>
</bean>
<bean id="transactionContextInitializer" class="org.jencks.interceptor.TransactionContextIn itializer" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="associator">
<ref local="connectionTracker" />
</property>
</bean>
<bean id="jcrTransactionManager" class="org.springframework.transaction.jta.JtaTran sactionManager" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="userTransaction">
<ref local="userTransaction" />
</property>
<property name="transactionManager">
<ref local="transactionManagerImpl" />
</property>
</bean>

<bean id="CoursePO"
class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="jcrTransactionManager"/></property>
<property name ="target">
<bean class="com.plateausystems.teamcontent.service.cour se.implementation.CoursePO"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED, -ApplicationException</prop>
</props>
</property>
</bean>
<bean id="jcrSessionFactory" class="org.springmodules.jcr.JcrSessionFactory">
<property name="repository" ref="repository"/>
<property name="credentials">
<bean class="javax.jcr.SimpleCredentials">
<constructor-arg index="0" value="bogus"/>
<constructor-arg index="1">
<bean factory-bean="password"
factory-method="toCharArray"/>
</constructor-arg>
</bean>
</property>
</bean>


<bean id="password" class="java.lang.String">
<constructor-arg index="0" value="pass"/>
</bean>

<bean id="CourseRepositoryDao" class="com.plateausystems.teamcontent.service.cour se.persistence.CourseRepositoryDao">
<property name="sessionFactory">
<ref bean="jcrSessionFactory"/>
</property>
</bean>

<bean id="repository" class="org.springmodules.jcr.jackrabbit.Repository FactoryBean">
<!--<property name="configuration" value="classpath:repository.xml"/>
<property name="homeDir" value="file://C:\plateaurepository\repository"/> -->
</bean>