-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: delete constraint validation
PostPosted: Wed Apr 02, 2008 9:55 am 
Newbie

Joined: Wed Apr 02, 2008 9:11 am
Posts: 1
Hi all,

I'm using hibernate with the bellow configuration:

Ejb3Configuration cfg = new Ejb3Configuration();
m_entityManagerFactory = cfg
.setProperty(Environment.DIALECT,"org.hibernate.dialect.SQLServerDialect")
.setProperty(Environment.CACHE_PROVIDER, "org.hibernate.cache.HashtableCacheProvider")

//.setProperty(Environment.CACHE_PROVIDER, "org.hibernate.cache.EhCacheProvider")
//.setProperty(Environment.GENERATE_STATISTICS, "true")
//.setProperty(Environment.USE_STRUCTURED_CACHE, "true")

.setProperty(Environment.USER, db.getUser())
.setProperty(Environment.PASS, db.getPassword())
.setProperty(Environment.URL, db.getSid())
.setProperty(Environment.DRIVER,db.getDriver())
.setProperty(Environment.SHOW_SQL, String.valueOf(InitServlet.IN_DEBUG_MODE))

//.setProperty(Environment.FORMAT_SQL,String.valueOf(InitServlet.IN_DEBUG_MODE))//Pretty print the SQL

//initialPoolSize C3P0 default: 3
//maxPoolSize - Hibernate default: 100
.setProperty(Environment.C3P0_MAX_SIZE, "100")
//minPoolSize - Hibernate default: 1
.setProperty(Environment.C3P0_MIN_SIZE, "5")
//timeout - The seconds a Connection can remain pooled but unused before being discarded.
//Zero means idle connections never expire. Hibernate default: 0
.setProperty(Environment.C3P0_TIMEOUT, "1800")//in sec
.setProperty(Environment.C3P0_MAX_STATEMENTS, "100")//0 to turn off c3p0 statement cache
//idle_test_period - If this is a number greater than 0, c3p0 will test all idle, pooled but unchecked-out connections,
//every this number of seconds.
.setProperty(Environment.C3P0_IDLE_TEST_PERIOD, "300")//in sec




I have 2 tables in Database with FK constraint validation sometimes after delete the parent record ( saw that the record was delete from database) trying to delete the child and recived :

SQLServerException: The DELETE statement conflicted with the REFERENCE constraint .


each delete use different EntityManager and transaction.


thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.