ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Schmidt" <...@knowledgelab.sdu.dk>
Subject Svar: RE: A concurrent acces has occurred.
Date Fri, 27 May 2005 07:38:03 GMT
Sorry if this is me being slow... 
I don't see the difference between your code: 
 
[snip]   
IBatisNet.DataMapper.SqlMapper sqlMap = Mapper.Get();    
 slqMap.BeginTransaction();    
 sqlMap.DataSource.ConnectionString = connstr;    
 for(int i=0; i<itemCount; i++)    
 {    
  sqlMap.Update("[statement]",[param])    
 }    
 sqlMap.CommitTransaction();    
[snap] 
 
and mine: 
 
[snip] 
 IbatisNet.DataMapper.SqlMapper sqlMap =
IBatisNet.DataMapper.Mapper.Instance() 
 sqlMap.BeginTransaction();     
 for (int i=0; i<al.Count; i++)     
 {     
 BudgetValueClass bv = (BudgetValueClass)al[i];     
 sqlMap.Update(BudgetValueClass.SetBudgetValue, bv);     
 }     
 sqlMap.CommitTransaction();     
[snap]

>>>jouni.karppinen@entegra.fi 05/27/05 8:56 am >>>
I had same problem with SQL Server. 
Workaround: 
I'm using  one SqlMapper instance inside the loop. 

IBatisNet.DataMapper.SqlMapper sqlMap = Mapper.Get(); 
slqMap.BeginTransaction(); 
sqlMap.DataSource.ConnectionString = connstr; 
for(int i=0; i<itemCount; i++) 
{ 
 sqlMap.Update("[statement]",[param]) 
} 
sqlMap.CommitTransaction(); 
  
-joopa- 
  
From: Morten Schmidt [mailto:sch@knowledgelab.sdu.dk]
Sent: 26. toukokuuta 2005 17:09
To:ibatis-user-cs@incubator.apache.org
Subject: A concurrent acces has occurred. 
  
I'm using iBatisNet, Npgsql and PostgreSQL (and log4net) 
  
I try to execute this (C#): 
  
  
Mapper().BeginTransaction(); 
for (int i=0; i<al.Count; i++) 
{  
BudgetValueClass bv = (BudgetValueClass)al[i]; 
Mapper().Update(BudgetValueClass.SetBudgetValue, bv); 
}  
Mapper().CommitTransaction(); 
  
  
  
al is a big ArrayList (about 5000 elements) 
BudgetValueClass is a class of my own 
Mapper() is an instance of SqlMapper 
  
BudgetValue.SetBudgetValue looks like this: 
  
<update id=

Mime
View raw message