Hi,

difficult to analyse what's going wrong. Are there associations between Employee, Department and Role? If yes, do you set auto-update 'true' or 'object'? Do you change any settings in OJB.properties file? Do you use one PB instance per thread (PB instances are not threadsafe)?

regards,
Armin

balaji sampath wrote:
Hello,

I have been using OJB with jakarta struts and having MYSQL 4 has database.

When I create an object for Persistance Broker and try to insert values into three of my tables.

Here is my insert method of my DAO object

public void insert(EmployeeVO employeevo,DepartVO departvo,RoleVO rolevo) throws DataAccessException {
log.info("inside EmployeeDAO.insert");
PersistenceBroker broker = null;
try {
broker = ServiceLocator.getInstance().findBroker();
broker.beginTransaction();
broker.store(employeevo);
broker.store(departvo);
broker.store(rolevo);
broker.commitTransaction();
}
.......................


The insertion of rows into the three tables was not a consistent one.It correctly inserts the rows into three tables in few cases or gives an exception PersistenceBrokerException: Message From server "Duplicate Entry 1-2345 for key 1"

When i looked into the employee table the row was properly inserted and the rows are not inserted into the rest of the two tables.I felt that the error was due to the persistance broker trying to insert the row in the employee table which was the first table for the second time after it has been inserted into the first time itself.That is the persistence broker is getting restarted.The execution of the code is inconsistent.

Could anyone in this group help to solve this problem.Expecting for a solution from you all.

Thanking You,

bill.

_________________________________________________________________
Best of Indian handicrafts. http://www.fabmall.com/affiliatehtml/redir/nl8.asp At MSN Shopping.



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to