Subject | Fwd: Hibernate and foreign key checks working on oracle fail without apparent r |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-05-29T19:12:47Z |
This post appeared in Firebird-Java group, but I suspect that it
belongs to support group. It seems that under some conditions FKs work
incorrectly, unless there's a bug in JDBC driver.
Thanks!
Roman
--- In Firebird-Java@yahoogroups.com, "Davide Baroncelli"
<baroncelli@y...> wrote:
Hello,
I'm sorry if my problem will show I'm a begineer with firebird and I
don't understand some basic concept of it, but being on a very slow
GPRS connection I don't even have an easy way to browse the archives...
I'm on firebird 1.5, jaybird 1.5 rc3, windows 2k, java 1.4.2_04, etc.
My problem happens on the architecture I'm working on, where the data
layer is managed by spring + hibernate. I normally work on an Oracle
DB, and the problem I'm experiencing with firebird does not occur. I
simply have an integration test suite where the tests are preceded by
a phase where a number of objects are persisted through hibernate in
order to create the initial configuration.
The problem is that on firebird, the creation fails because of foreign
key constraints that firebird reports not being respected, but I
carefully checked the sql that is generated by hibernate (I installed
p6spy in order to monitor it more easily), and everything seems ok to
me (in fact the same tests work on oracle): the lines creating the
apparently missing objects are correctly present in the sql log before
the line that refers to them, and fails because of the fk. Moreover,
if I disable the constraints the problem disappears, the setup is
correctly completed and the test finally succeeds. Am I doing
something wrong?
Here is a little more detail (complete SQL, exception log, description
of the FK that fails and consideration about the existence of the line
that the fk failure seem to tell does not
All the initial setup is done in a transaction that gets rolled back
after the error. The complete sql that is executed in my test is:
1085832639486| 40|1|statement||alter table CONDITION add PARAM_2
NUMERIC(18, 19)
1085832639526| 0|1|statement||create generator PARTY_SEQ
1085832639576| 10|1|statement||create generator CATEGORY_OPTION_GROUP_SEQ
1085832639606| 0|1|statement||create generator CHANNEL_SEQ
1085832639646| 0|1|statement||create generator
PRODUCT_IDENTIFICATION_TYP_SEQ
1085832639686| 0|1|statement||create generator CONDITION_SEQ
1085832639746| 0|1|statement||create generator CATEGORY_TYPE_SEQ
1085832639796| 0|1|statement||create generator USER_LOGIN_SEQ
1085832639836| 0|1|statement||create generator ORDER_LINE_SEQ
1085832639916| 0|1|statement||create generator STORE_SEQ
1085832639957| 0|1|statement||create generator SEC_GROUP_SEQ
1085832639987| 0|1|statement||create generator SEC_PERM_SEQ
1085832640007| 0|1|statement||create generator RULE_SEQ
1085832640067| 10|1|statement||create generator BASKET_LINE_SEQ
1085832640107| 0|1|statement||create generator STORE_TYPE_SEQ
1085832640157| 10|1|statement||create generator PRODUCT_OPTION_GROUP_SEQ
1085832640197| 0|1|statement||create generator DELIVERY_AREA_SEQ
1085832640247| 10|1|statement||create generator PRODUCT_OPTION_SEQ
1085832640287| 20|1|statement||create generator PROMOTION_SEQ
1085832640317| 0|1|statement||create generator CATEGORY_SEQ
1085832640367| 0|1|statement||create generator CATALOG_SEQ
1085832640407| 0|1|statement||create generator REGION_SEQ
1085832640477| 0|1|statement||create generator ADDRESS_SEQ
1085832640557| 0|1|statement||create generator ENUM_SEQ
1085832640607| 10|1|statement||create generator CATEGORY_OPTION_SEQ
1085832640627| 0|1|statement||create generator SHOPPING_LIST_LINE_SEQ
1085832640658| 0|1|statement||create generator STORE_ORDER_LINE_SEQ
1085832640758| 0|1|statement||create generator SHOPPING_LIST_TYPE_SEQ
1085832640798| 0|1|statement||create generator DELIVERY_SLOT_SEQ
1085832640838| 0|1|statement||create generator ORDER_SEQ
1085832640888| 0|1|statement||create generator PRODUCT_ASSOCIATION_TYP_SEQ
1085832640928| 0|1|statement||create generator SHOPPING_LIST_SEQ
1085832640988| 0|1|statement||create generator STREET_SEQ
1085832641008| 0|1|statement||create generator PROVINCE_SEQ
1085832641038| 0|1|statement||create generator CATALOG_TYPE_SEQ
1085832641108| 40|1|statement||create generator BASKET_SEQ
1085832641168| 20|1|statement||create generator COMMUNA_SEQ
1085832641188| 0|1|statement||create generator COUNTRY_SEQ
1085832641218| 10|1|statement||create generator PRODUCT_SEQ
1085832641238| 0|1|statement||create generator FAILED_REG_SEQ
1085832641359| 61|1|commit||
1085832642921| 30|1|statement|select gen_id( CHANNEL_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CHANNEL_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( CHANNEL_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CHANNEL_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_TYPE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_TYPE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( COUNTRY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COUNTRY_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( REGION_SEQ, 1 ) from
RDB$DATABASE|select gen_id( REGION_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_TYPE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_TYPE_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643111| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_GROUP_SEQ, 1
) from RDB$DATABASE|select gen_id( PRODUCT_OPTION_GROUP_SEQ, 1 ) from
RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_SEQ, 1 )
from RDB$DATABASE|select gen_id( PRODUCT_OPTION_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_SEQ, 1 )
from RDB$DATABASE|select gen_id( PRODUCT_OPTION_SEQ, 1 ) from RDB$DATABASE
1085832643261| 0|1|statement|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values (?, ?)|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values ('example channel 0', 253)
1085832643261| 0|1|statement|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values (?, ?)|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values ('example channels 1', 254)
1085832643261| 0|1|statement|insert into STORE_TYPE (DESCRIPTION,
TYPE_NAME, STORE_TYPE_ID) values (?, ?, ?)|insert into STORE_TYPE
(DESCRIPTION, TYPE_NAME, STORE_TYPE_ID) values ('example store type',
'supermercato', 127)
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('store di
casa mia', 'via pippo 12', 'io', 'io@i...', 'true', 'true',
'url.gif', 0.0, '0257402284', '025521589', 'boh', 'false', 127, 253)
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('un altro
store', 'via qualcosa 2', 'no', 'nessuno@n...', 'true', 'true',
'url.gif', 0.0, '02425345345', '023434155', 'boh', 'false', 127, 254)
1085832643311| 20|1|statement|insert into DELIVERY_AREA
(DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL, PRIMARY_STORE_ID,
CHANNEL_ID, DELIVERY_AREA_ID) values (?, ?, ?, ?, ?, ?)|insert into
DELIVERY_AREA (DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL,
PRIMARY_STORE_ID, CHANNEL_ID, DELIVERY_AREA_ID) values ('area di casa
mia', '', 'http://www.pippo.com', 253, 253, 415)
1085832643962| 510|1|rollback||
The rollback is executed because the following exception is thrown
after the last operation:
14:10:43,311 ERROR [JDBCExceptionReporter] could not insert:
[it.esselunga.ecommerce.data.model.DeliveryArea#415]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466.
violation of FOREIGN KEY constraint "FKA82BCDF898CEBF16" on table
"DELIVERY_AREA" at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:453)
And the given constraint (FKA82BCDF898CEBF16) is
DELIVERY_AREA.PRIMARY_STORE_ID referring to STORE.STORE_ID
but if you look at the sql log, the line that fails
1085832643311| 20|1|statement|insert into DELIVERY_AREA
(DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL, PRIMARY_STORE_ID,
CHANNEL_ID, DELIVERY_AREA_ID) values (?, ?, ?, ?, ?, ?)|insert into
DELIVERY_AREA (DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL,
PRIMARY_STORE_ID, CHANNEL_ID, DELIVERY_AREA_ID) values ('area di casa
mia', '', 'http://www.pippo.com', 253, 253, 415)
is correctly preceded by
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('store di
casa mia', 'via pippo 12', 'io', 'io@i...', 'true', 'true',
'url.gif', 0.0, '0257402284', '025521589', 'boh', 'false', 127, 253)
As I've told before, if I do remove all the failing constraints
(removing the first one causes a number of other to fail in a non
explicable way) and stop the program just after the transaction
commit, the situation is perfectly consistent and the test finally
succeeds (also removing the initially created lines at test teardown).
Is there anyone that could explain to me what I'm doing wrong or what
I could be forgetting?
Thanks,
Davide Baroncelli
P.s. : full exception log is:
14:10:43,311 ERROR [JDBCExceptionReporter] could not insert:
[it.esselunga.ecommerce.data.model.DeliveryArea#415]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466.
violation of FOREIGN KEY constraint "FKA82BCDF898CEBF16" on table
"DELIVERY_AREA"
at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:453)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:144)
at
com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at
net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2360)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at it.esselunga.ecommerce.test.SavePoint.execute(SavePoint.java:15)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.executeAction(SpringHibernateBulkObjectPersister.java:155)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister$1.doInHibernate(SpringHibernateBulkObjectPersister.java:121)
at
org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.applyInChunks(SpringHibernateBulkObjectPersister.java:109)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.createPersistentObjects(SpringHibernateBulkObjectPersister.java:63)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.persist(SpringHibernateBulkObjectPersister.java:48)
at
it.esselunga.ecommerce.test.SpringAwareTestCaseSupport.setUp(SpringAwareTestCaseSupport.java:60)
at
it.esselunga.ecommerce.services.promo.IntegrationTestWeightLimitRule.setUp(IntegrationTestWeightLimitRule.java:53)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown
Source)
at junit.textui.TestRunner.start(TestRunner.java:172)
at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
Source)
at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
Source)
at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
at
org.firebirdsql.gds.GDSException: violation of FOREIGN KEY constraint
"FKA82BCDF898CEBF16" on table "DELIVERY_AREA"
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1759)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1712)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:911)
at
org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:766)
at
org.firebirdsql.jdbc.AbstractConnection.executeStatement(AbstractConnection.java:922)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:449)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:144)
at
com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at
net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2360)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at it.esselunga.ecommerce.test.SavePoint.execute(SavePoint.java:15)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.executeAction(SpringHibernateBulkObjectPersister.java:155)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister$1.doInHibernate(SpringHibernateBulkObjectPersister.java:121)
at
org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.applyInChunks(SpringHibernateBulkObjectPersister.java:109)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.createPersistentObjects(SpringHibernateBulkObjectPersister.java:63)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.persist(SpringHibernateBulkObjectPersister.java:48)
at
it.esselunga.ecommerce.test.SpringAwareTestCaseSupport.setUp(SpringAwareTestCaseSupport.java:60)
at
it.esselunga.ecommerce.services.promo.IntegrationTestWeightLimitRule.setUp(IntegrationTestWeightLimitRule.java:53)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown
Source)
at junit.textui.TestRunner.start(TestRunner.java:172)
at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
Source)
at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
Source)
at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
--- End forwarded message ---
belongs to support group. It seems that under some conditions FKs work
incorrectly, unless there's a bug in JDBC driver.
Thanks!
Roman
--- In Firebird-Java@yahoogroups.com, "Davide Baroncelli"
<baroncelli@y...> wrote:
Hello,
I'm sorry if my problem will show I'm a begineer with firebird and I
don't understand some basic concept of it, but being on a very slow
GPRS connection I don't even have an easy way to browse the archives...
I'm on firebird 1.5, jaybird 1.5 rc3, windows 2k, java 1.4.2_04, etc.
My problem happens on the architecture I'm working on, where the data
layer is managed by spring + hibernate. I normally work on an Oracle
DB, and the problem I'm experiencing with firebird does not occur. I
simply have an integration test suite where the tests are preceded by
a phase where a number of objects are persisted through hibernate in
order to create the initial configuration.
The problem is that on firebird, the creation fails because of foreign
key constraints that firebird reports not being respected, but I
carefully checked the sql that is generated by hibernate (I installed
p6spy in order to monitor it more easily), and everything seems ok to
me (in fact the same tests work on oracle): the lines creating the
apparently missing objects are correctly present in the sql log before
the line that refers to them, and fails because of the fk. Moreover,
if I disable the constraints the problem disappears, the setup is
correctly completed and the test finally succeeds. Am I doing
something wrong?
Here is a little more detail (complete SQL, exception log, description
of the FK that fails and consideration about the existence of the line
that the fk failure seem to tell does not
All the initial setup is done in a transaction that gets rolled back
after the error. The complete sql that is executed in my test is:
1085832639486| 40|1|statement||alter table CONDITION add PARAM_2
NUMERIC(18, 19)
1085832639526| 0|1|statement||create generator PARTY_SEQ
1085832639576| 10|1|statement||create generator CATEGORY_OPTION_GROUP_SEQ
1085832639606| 0|1|statement||create generator CHANNEL_SEQ
1085832639646| 0|1|statement||create generator
PRODUCT_IDENTIFICATION_TYP_SEQ
1085832639686| 0|1|statement||create generator CONDITION_SEQ
1085832639746| 0|1|statement||create generator CATEGORY_TYPE_SEQ
1085832639796| 0|1|statement||create generator USER_LOGIN_SEQ
1085832639836| 0|1|statement||create generator ORDER_LINE_SEQ
1085832639916| 0|1|statement||create generator STORE_SEQ
1085832639957| 0|1|statement||create generator SEC_GROUP_SEQ
1085832639987| 0|1|statement||create generator SEC_PERM_SEQ
1085832640007| 0|1|statement||create generator RULE_SEQ
1085832640067| 10|1|statement||create generator BASKET_LINE_SEQ
1085832640107| 0|1|statement||create generator STORE_TYPE_SEQ
1085832640157| 10|1|statement||create generator PRODUCT_OPTION_GROUP_SEQ
1085832640197| 0|1|statement||create generator DELIVERY_AREA_SEQ
1085832640247| 10|1|statement||create generator PRODUCT_OPTION_SEQ
1085832640287| 20|1|statement||create generator PROMOTION_SEQ
1085832640317| 0|1|statement||create generator CATEGORY_SEQ
1085832640367| 0|1|statement||create generator CATALOG_SEQ
1085832640407| 0|1|statement||create generator REGION_SEQ
1085832640477| 0|1|statement||create generator ADDRESS_SEQ
1085832640557| 0|1|statement||create generator ENUM_SEQ
1085832640607| 10|1|statement||create generator CATEGORY_OPTION_SEQ
1085832640627| 0|1|statement||create generator SHOPPING_LIST_LINE_SEQ
1085832640658| 0|1|statement||create generator STORE_ORDER_LINE_SEQ
1085832640758| 0|1|statement||create generator SHOPPING_LIST_TYPE_SEQ
1085832640798| 0|1|statement||create generator DELIVERY_SLOT_SEQ
1085832640838| 0|1|statement||create generator ORDER_SEQ
1085832640888| 0|1|statement||create generator PRODUCT_ASSOCIATION_TYP_SEQ
1085832640928| 0|1|statement||create generator SHOPPING_LIST_SEQ
1085832640988| 0|1|statement||create generator STREET_SEQ
1085832641008| 0|1|statement||create generator PROVINCE_SEQ
1085832641038| 0|1|statement||create generator CATALOG_TYPE_SEQ
1085832641108| 40|1|statement||create generator BASKET_SEQ
1085832641168| 20|1|statement||create generator COMMUNA_SEQ
1085832641188| 0|1|statement||create generator COUNTRY_SEQ
1085832641218| 10|1|statement||create generator PRODUCT_SEQ
1085832641238| 0|1|statement||create generator FAILED_REG_SEQ
1085832641359| 61|1|commit||
1085832642921| 30|1|statement|select gen_id( CHANNEL_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CHANNEL_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( CHANNEL_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CHANNEL_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_TYPE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_TYPE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( STORE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STORE_SEQ, 1 ) from RDB$DATABASE
1085832643001| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( DELIVERY_AREA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( DELIVERY_AREA_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( COUNTRY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COUNTRY_SEQ, 1 ) from RDB$DATABASE
1085832643011| 0|1|statement|select gen_id( REGION_SEQ, 1 ) from
RDB$DATABASE|select gen_id( REGION_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643041| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643051| 0|1|statement|select gen_id( PROVINCE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PROVINCE_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643061| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( COMMUNA_SEQ, 1 ) from
RDB$DATABASE|select gen_id( COMMUNA_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643071| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643081| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643091| 0|1|statement|select gen_id( STREET_SEQ, 1 ) from
RDB$DATABASE|select gen_id( STREET_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_TYPE_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_TYPE_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( CATEGORY_SEQ, 1 ) from
RDB$DATABASE|select gen_id( CATEGORY_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643101| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643111| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_SEQ, 1 ) from
RDB$DATABASE|select gen_id( PRODUCT_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_GROUP_SEQ, 1
) from RDB$DATABASE|select gen_id( PRODUCT_OPTION_GROUP_SEQ, 1 ) from
RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_SEQ, 1 )
from RDB$DATABASE|select gen_id( PRODUCT_OPTION_SEQ, 1 ) from RDB$DATABASE
1085832643121| 0|1|statement|select gen_id( PRODUCT_OPTION_SEQ, 1 )
from RDB$DATABASE|select gen_id( PRODUCT_OPTION_SEQ, 1 ) from RDB$DATABASE
1085832643261| 0|1|statement|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values (?, ?)|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values ('example channel 0', 253)
1085832643261| 0|1|statement|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values (?, ?)|insert into CHANNEL (DESCRIPTION,
CHANNEL_ID) values ('example channels 1', 254)
1085832643261| 0|1|statement|insert into STORE_TYPE (DESCRIPTION,
TYPE_NAME, STORE_TYPE_ID) values (?, ?, ?)|insert into STORE_TYPE
(DESCRIPTION, TYPE_NAME, STORE_TYPE_ID) values ('example store type',
'supermercato', 127)
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('store di
casa mia', 'via pippo 12', 'io', 'io@i...', 'true', 'true',
'url.gif', 0.0, '0257402284', '025521589', 'boh', 'false', 127, 253)
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('un altro
store', 'via qualcosa 2', 'no', 'nessuno@n...', 'true', 'true',
'url.gif', 0.0, '02425345345', '023434155', 'boh', 'false', 127, 254)
1085832643311| 20|1|statement|insert into DELIVERY_AREA
(DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL, PRIMARY_STORE_ID,
CHANNEL_ID, DELIVERY_AREA_ID) values (?, ?, ?, ?, ?, ?)|insert into
DELIVERY_AREA (DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL,
PRIMARY_STORE_ID, CHANNEL_ID, DELIVERY_AREA_ID) values ('area di casa
mia', '', 'http://www.pippo.com', 253, 253, 415)
1085832643962| 510|1|rollback||
The rollback is executed because the following exception is thrown
after the last operation:
14:10:43,311 ERROR [JDBCExceptionReporter] could not insert:
[it.esselunga.ecommerce.data.model.DeliveryArea#415]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466.
violation of FOREIGN KEY constraint "FKA82BCDF898CEBF16" on table
"DELIVERY_AREA" at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:453)
And the given constraint (FKA82BCDF898CEBF16) is
DELIVERY_AREA.PRIMARY_STORE_ID referring to STORE.STORE_ID
but if you look at the sql log, the line that fails
1085832643311| 20|1|statement|insert into DELIVERY_AREA
(DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL, PRIMARY_STORE_ID,
CHANNEL_ID, DELIVERY_AREA_ID) values (?, ?, ?, ?, ?, ?)|insert into
DELIVERY_AREA (DELIVERY_AREA_NAME, DESCRIPTION, HOME_URL,
PRIMARY_STORE_ID, CHANNEL_ID, DELIVERY_AREA_ID) values ('area di casa
mia', '', 'http://www.pippo.com', 253, 253, 415)
is correctly preceded by
1085832643271| 0|1|statement|insert into STORE (STORE_NAME, ADDRESS,
CONTACT, EMAIL, HOME_URL, HOME_URL_MAIN, GIF_URL,
MINIMUM_SHOPPING_THRESHOLD, TEL, FAX, STORE_REF, DELETED,
STORE_TYPE_ID, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?)|insert into STORE (STORE_NAME, ADDRESS, CONTACT, EMAIL,
HOME_URL, HOME_URL_MAIN, GIF_URL, MINIMUM_SHOPPING_THRESHOLD, TEL,
FAX, STORE_REF, DELETED, STORE_TYPE_ID, STORE_ID) values ('store di
casa mia', 'via pippo 12', 'io', 'io@i...', 'true', 'true',
'url.gif', 0.0, '0257402284', '025521589', 'boh', 'false', 127, 253)
As I've told before, if I do remove all the failing constraints
(removing the first one causes a number of other to fail in a non
explicable way) and stop the program just after the transaction
commit, the situation is perfectly consistent and the test finally
succeeds (also removing the initially created lines at test teardown).
Is there anyone that could explain to me what I'm doing wrong or what
I could be forgetting?
Thanks,
Davide Baroncelli
P.s. : full exception log is:
14:10:43,311 ERROR [JDBCExceptionReporter] could not insert:
[it.esselunga.ecommerce.data.model.DeliveryArea#415]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466.
violation of FOREIGN KEY constraint "FKA82BCDF898CEBF16" on table
"DELIVERY_AREA"
at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:453)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:144)
at
com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at
net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2360)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at it.esselunga.ecommerce.test.SavePoint.execute(SavePoint.java:15)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.executeAction(SpringHibernateBulkObjectPersister.java:155)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister$1.doInHibernate(SpringHibernateBulkObjectPersister.java:121)
at
org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.applyInChunks(SpringHibernateBulkObjectPersister.java:109)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.createPersistentObjects(SpringHibernateBulkObjectPersister.java:63)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.persist(SpringHibernateBulkObjectPersister.java:48)
at
it.esselunga.ecommerce.test.SpringAwareTestCaseSupport.setUp(SpringAwareTestCaseSupport.java:60)
at
it.esselunga.ecommerce.services.promo.IntegrationTestWeightLimitRule.setUp(IntegrationTestWeightLimitRule.java:53)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown
Source)
at junit.textui.TestRunner.start(TestRunner.java:172)
at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
Source)
at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
Source)
at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
at
org.firebirdsql.gds.GDSException: violation of FOREIGN KEY constraint
"FKA82BCDF898CEBF16" on table "DELIVERY_AREA"
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1759)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1712)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:911)
at
org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:766)
at
org.firebirdsql.jdbc.AbstractConnection.executeStatement(AbstractConnection.java:922)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:449)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:144)
at
com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at
net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:468)
at
net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at
net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2360)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
at it.esselunga.ecommerce.test.SavePoint.execute(SavePoint.java:15)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.executeAction(SpringHibernateBulkObjectPersister.java:155)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister$1.doInHibernate(SpringHibernateBulkObjectPersister.java:121)
at
org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.applyInChunks(SpringHibernateBulkObjectPersister.java:109)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.createPersistentObjects(SpringHibernateBulkObjectPersister.java:63)
at
it.esselunga.ecommerce.test.SpringHibernateBulkObjectPersister.persist(SpringHibernateBulkObjectPersister.java:48)
at
it.esselunga.ecommerce.test.SpringAwareTestCaseSupport.setUp(SpringAwareTestCaseSupport.java:60)
at
it.esselunga.ecommerce.services.promo.IntegrationTestWeightLimitRule.setUp(IntegrationTestWeightLimitRule.java:53)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown
Source)
at junit.textui.TestRunner.start(TestRunner.java:172)
at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
Source)
at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
Source)
at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
--- End forwarded message ---