db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: Inconsistence in Persistence Broker
Date Thu, 13 May 2004 07:54:18 GMT
Hi Bill,

now it's a bit clearer, but not enough ;-)
Could you post the mapping in repository file for Employee, Department 
and Role?
Did you set a sequence manager or do you use the default one?



 > table.Where should i set auto-update parameter,and what should i set it
 > as 'true' or 'object'.

You don't need to change this, I only want to know if you change these 
settings.


 > file.I have been using "Default" Persistence Broker.Should i create one
 > of my own.

You don't need to change this, I only want to know if you change these 
settings.

How do you build the objects before calling
public void insert(EmployeeVO employeevo,DepartVO departvo,RoleVO rolevo)
method - Do you set the FK by hand ...? Can you post this code too?

regards,
Armin

balaji sampath wrote:
> 
> Hello,
> 
> Thanks Armin for analysing my problem.There are association between 
> these tables.employee id in department and role refers the employee 
> table.Where should i set auto-update parameter,and what should i set it 
> as 'true' or 'object'.I have not changed the settings of OJB.properties 
> file.I have been using "Default" Persistence Broker.Should i create one 
> of my own.
> 
> Expecting for a solution from you all.
> 
> Thanking You,
> 
> bill
> 
> 
>> From: Armin Waibel <arminw@apache.org>
>> Reply-To: "OJB Users List" <ojb-user@db.apache.org>
>> To: OJB Users List <ojb-user@db.apache.org>
>> Subject: Re: Inconsistence in Persistence Broker
>> Date: Tue, 11 May 2004 00:15:37 +0200
>>
>> 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: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
> 
> _________________________________________________________________
> Earn without investing. http://go.msnserver.com/IN/48713.asp Sell  
> anything  on www.baazee.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message