db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Colantoni <alessandro.colant...@gmail.com>
Subject Re: primary key problem sql server
Date Mon, 20 Jun 2005 10:32:40 GMT
Hi
in repository_database.xml I have
 <jdbc-connection-descriptor jcd-alias="default" default-connection="true" 
platform="MsSQLServer" jdbc-level="2.0" driver="
com.microsoft.jdbc.sqlserver.SQLServerDriver" protocol="jdbc" 
subprotocol="microsoft:sqlserver" 
dbalias="//walqasrv01:1433;DatabaseName=trayectorias" username="steria" 
password="filemon" eager-release="false" batch-mode="false" 
useAutoCommit="2" ignoreAutoCommitExceptions="false">
 In OJB.properties I have
ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl
 thanks


 On 6/20/05, Martin Kalén <mkalen@apache.org> wrote: 
> 
> Alessandro Colantoni wrote:
> > I'm using ojb 1.0.1 with sql server.
> > When I store an object, and then I delete it directly on the db I can't
> > insert it a second time.
> > Before storing I use to check if an object with the same key exists.
> > ojb doesn't detect any object with the same key (correctly... I deleted 
> it)
> > But when storing it catch a sql server exception because primary key 
> already
> > exists.
> > Is it a limit of microsoft sql server (it keeps primary key somewhere?) 
> or
> > I'm doing something wrong?
> 
> This sounds like a transaction isolation problem. If you use the PB API 
> with
> OJB without the two-level cache you will not have any transaction 
> isolation
> and a delete will be directly visible in the cache before commit.
> 
> However, if you don't use auto-commit on the Connection to MSSQL the 
> database
> DELETE will not be performed until COMMIT.
> 
> What is your auto-commit setting in repository_database.xml and which OJB 
> API
> are you using?
> 
> Regards,
> Martin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message