You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Morten Schmidt <sc...@knowledgelab.sdu.dk> on 2005/05/26 16:08:49 UTC

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=SetBudgetValue parameterClass=BudgetValueClass> 
update budgetvalue set 
budgetvalue = #BudgetValue# 
WHERE budgetid = #BudgetId# 
AND accountid = #AccountId# 
AND dataid = #DataId# 
AND month = #Month# 
AND year = #Year# 
</update> 
 
 
It compiles OK, but running the asp.net page I get the following error
on Exception: 
 
A concurrent acces has occurred. 
 
(with the wrong spelling ;o)  ) 
 
Does anyone know what is happening? I can't get it to work for me... 
 
Thank you in advance... (and I hope this is the place to ask...) 
 
/morten 


Re: A concurrent acces has occurred.

Posted by Roberto R <ro...@gmail.com>.
This sounds like a PostgreSQL exception/error. Can you verify that the list 
(big list of 5000 elements!) does not have duplicate values that are being 
used for the where clause?

Roberto


On 5/26/05, Morten Schmidt <sc...@knowledgelab.sdu.dk> wrote:
> 
>  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="SetBudgetValue" parameterClass="BudgetValueClass"> 
>  update budgetvalue set 
>  budgetvalue = #BudgetValue# 
>  WHERE budgetid = #BudgetId# 
>  AND accountid = #AccountId# 
>  AND dataid = #DataId# 
>  AND month = #Month# 
>  AND year = #Year# 
>  </update> 
>    It compiles OK, but running the asp.net <http://asp.net> page I get the 
> following error on Exception: 
>   A concurrent acces has occurred. 
>   (with the wrong spelling ;o) ) 
>   Does anyone know what is happening? I can't get it to work for me... 
>   Thank you in advance... (and I hope this is the place to ask...) 
>   /morten 
>

RE: A concurrent acces has occurred.

Posted by Jouni Karppinen <jo...@entegra.fi>.
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="SetBudgetValue" parameterClass="BudgetValueClass"> 

update budgetvalue set 

budgetvalue = #BudgetValue# 

WHERE budgetid = #BudgetId# 

AND accountid = #AccountId# 

AND dataid = #DataId# 

AND month = #Month# 

AND year = #Year# 

</update> 

 

 

It compiles OK, but running the asp.net page I get the following error on
Exception: 

 

A concurrent acces has occurred. 

 

(with the wrong spelling ;o)  ) 

 

Does anyone know what is happening? I can't get it to work for me... 

 

Thank you in advance... (and I hope this is the place to ask...) 

 

/morten