All,

I am trying to insert a record into DB and insert a node in Jackrabbit repository in a single transaction. I am using Spring module's JCR support for accessing the repository and HibernateDAOSupport
for accessing the Database.

If there is any exception while accessing the repository,
both the operation should be rolled back.

If everythig goes fine, both needs to be committed.

1)What's the transaction manager should I use in this scenario.
2)Also should I call session.save() in DAO explicitly or not ?

public void save(final Course course)throws DataAccessException
    {
            log.info("Save Method");
            getJcrTemplate().execute(new JcrCallback() {
                  public Object doInJcr(Session session) throws
                        RepositoryException {
                    Node root = session.getRootNode();>
                    Node sample = root.addNode( course.getName()
                        ,"nt:unstructured");
                    //session.save();
                    return null;
                  }
                });
    }

_________________________________________________________________
One and only Ash. Find out all about her. Only on MSN Search http://server1.msn.co.in/profile/aishwarya.asp

Reply via email to