Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AADED18C21 for ; Wed, 20 Apr 2016 08:07:57 +0000 (UTC) Received: (qmail 76483 invoked by uid 500); 20 Apr 2016 08:07:57 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 76450 invoked by uid 500); 20 Apr 2016 08:07:57 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 76438 invoked by uid 99); 20 Apr 2016 08:07:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2016 08:07:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7C173C0051 for ; Wed, 20 Apr 2016 08:07:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.797 X-Spam-Level: X-Spam-Status: No, score=0.797 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=netorg75979.onmicrosoft.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id tfXECoFUriyH for ; Wed, 20 Apr 2016 08:07:54 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0116.outbound.protection.outlook.com [157.56.111.116]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A4A475FAE6 for ; Wed, 20 Apr 2016 08:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG75979.onmicrosoft.com; s=selector1-valsphere-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zdNLXfCB0J0DIRnPIY3hV/wT5AmzVme5lpw0ab0toss=; b=hRSbNEv6jDEz7dpfUPrcV5gHMzrcJHHLI6JQuNnugsldBZlalsmDDmx08h5SjcYmfI6C/ilM3HFW3qSVzn0ayOwWSk5g8FS8I5pqT6UrIxoLrjsoeYlZvEBmvnpGPHWFZrPgpDV3L53t1Cr+RCNxadvkk4jqJLTrjRAJq4ZIfGA= Received: from BY2PR06MB2133.namprd06.prod.outlook.com (10.166.113.25) by BY2PR06MB2136.namprd06.prod.outlook.com (10.166.113.28) with Microsoft SMTP Server (TLS) id 15.1.466.19; Wed, 20 Apr 2016 08:07:44 +0000 Received: from BY2PR06MB2133.namprd06.prod.outlook.com ([10.166.113.25]) by BY2PR06MB2133.namprd06.prod.outlook.com ([10.166.113.25]) with mapi id 15.01.0466.022; Wed, 20 Apr 2016 08:07:44 +0000 From: Adam Boyle To: Cayenne Users Subject: Re: ROP - Define order of inserts on large commit to multiple tables with relationships? Thread-Topic: ROP - Define order of inserts on large commit to multiple tables with relationships? Thread-Index: AQHRmTThppcaQ4lcS028J+eSFRzmiZ+RUh0AgAAXz5CAARXNEQ== Date: Wed, 20 Apr 2016 08:07:44 +0000 Message-ID: References: ,, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: cayenne.apache.org; dkim=none (message not signed) header.d=none;cayenne.apache.org; dmarc=none action=none header.from=valsphere.com; x-originating-ip: [132.245.54.101] x-ms-office365-filtering-correlation-id: a49053cb-0238-4e4f-8073-08d368f2da64 x-microsoft-exchange-diagnostics: 1;BY2PR06MB2136;5:0qj1KFAybq1NCXt12IK3epfPDStpUOVwgHcpHg5aPWZC2YZZa3SeOs5rkiyVUf7TAeYKjlzliua+A8pNzqdovUWwYAqnU8DTQERn5FvFu+qwdTFnMivVV+oigWQf1Y1YJYs2dI+BJkNdgVUwtz+UAR02YJfyxgq3adlIWn+UBZ5P095txrVJl8+JNpmgEsFj;24:7HZWYoQ29OkhZeBWNOVaYsf8DHwJ4Fcu4JucS/K4TqSgqeG3Jxdk5ViXaeNgjL7H9gEvpOWJux9ioxjS9rkvd+CcsuHvG7qL6Y8/1G1l8Lc=;7:SStZvRlM3wQxfv5GbPAYKpTaRK/yJN6MCn1VYZSZKSQVNEn/oQwOu4UOMOK49/VJnpet13JFt6BYsmiDqpsJdWgFZHsLNWbw++wzCzQuvcQv+7hKj2/dSDUwg8euOJTSIgfvMsIqK4L8wAfkW1QIoMCo6x6QV+0hjgP4kjS5JV6/k2F1s32EqfH7onUQ4Mehucc+MMzKSyYWywFBc1QgtTuMl9Z1C2vg9/NKfdlIsgE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR06MB2136; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521026)(6040130)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041046)(6043046);SRVR:BY2PR06MB2136;BCL:0;PCL:0;RULEID:;SRVR:BY2PR06MB2136; x-forefront-prvs: 0918748D70 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(377454003)(76576001)(5004730100002)(74316001)(50986999)(2906002)(9686002)(110136002)(92566002)(107886002)(189998001)(66066001)(19580405001)(19580395003)(54356999)(76176999)(11100500001)(87936001)(5002640100001)(86362001)(586003)(6116002)(5008740100001)(99286002)(551934003)(3660700001)(10400500002)(1096002)(1220700001)(106116001)(450100001)(15975445007)(81166005)(3280700002)(2950100001)(2900100001)(3846002)(33656002)(102836003)(5003600100002)(122556002)(77096005)(579004);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR06MB2136;H:BY2PR06MB2133.namprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: valsphere.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2016 08:07:44.3047 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 552f1932-42eb-4db3-a137-fd645bffe074 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR06MB2136 Since Andrus just mentioned docs in another thread, here is how I added the= custom module loading to my ROP setup to add the WeightedAshwoodEntitySort= er support in web.xml: http://cayenne.apache.org/docs/4.0/tutorial-rop/ch03.html#running-rop-serve= r cayenne-project org.apache.cayenne.configuration.rop.server.ROPHessi= anServlet extra-modules package.path.to.CustomModule 0 Module class: public class CustomModule implements Module { @Override public void configure(Binder binder) { binder.bindMap(Constants.PROPERTIES_MAP).put(Constants.SERVER_CONTE= XTS_SYNC_PROPERTY, "false"); binder.bind(EntitySorter.class).to(WeightedAshwoodEntitySorter.clas= s); } } Hopefully this will help someone else doing this for the first time to figu= re it out :) ________________________________________ From: Adam Boyle Sent: Tuesday, April 19, 2016 12:56 PM To: Cayenne Users Subject: Re: ROP - Define order of inserts on large commit to multiple tabl= es with relationships? Hi Michael, Although my setup is not exactly the same, there are definite similarities,= namely in the method to fetch a current revision. I may end up reverting t= he changes to add the circular FK relationships... it's probably not much d= ifferent performance-wise to the server if I have to fetch a revision by it= s PK than if I fetch it from the parent PK (a FK on the revision) and a nul= l replaced_ts, which I've added as indexes on all the revision tables (pare= nt_pk + replaced_ts ). Either way the server has to run a query on indexed = columns, right? -Adam ________________________________________ From: Michael Gentry Sent: Tuesday, April 19, 2016 9:49 AM To: Cayenne Users Subject: Re: ROP - Define order of inserts on large commit to multiple tabl= es with relationships? Hi Adam, To follow-up on Andrus' comment, have you considered recursive relationships? To do so, your TestScript would have getParent() and getPrevious() type methods/relationships which return a TestScript (if it exists) plus a parentFK attribute. I've used the following pattern in the past: TestScript previousTS =3D // your current TestScript TestScript newTS =3D context.newObject(TestScript.class); // Copy/set values from previousTS to newTS ... previousTS.setParent(newTS); ... context.commitChanges(); This gives you a chain like: TS <<-> TS <<-> TS <<-> TS <<-> TS The TS on the left is the oldest revision. To fetch the active TS, fetch the one that doesn't have a parent relationship. mrg On Mon, Apr 18, 2016 at 10:50 PM, Adam Boyle wrote: > I have sets of tables that contain versioned data; one table acts as the > parent and the other contains the revisions of the parent. The parent > record stores a long PK and a string ID. The revisions table stores a lon= g > PK, the long PK of the parent (with FK relationship), a replacement date > (if null, this is the current revision), and the versioned data fields. I= f > I want to get the current revision from a parent object I perform an > ObjectSelect query to find the revision with the null date field. > > > Today I realized that this is a costly way to retrieve the current > revision, so I added a current_revision_pid column to all the parent tabl= es > and a FK relationship to the revision tables. At this point you may be > thinking "that's a circular FK constraint", but I mitigated this by maki= ng > the current_revision_pid column non-mandatory and resolving to only set > that column on new records AFTER the parent and new revision have been > committed. > > > Since adding the new FK relationships I am seeing errors in code that wa= s > working fine before the change to add the additional relationships. It > appears the table insertions are not occurring in the correct order. > > Code: > > TestScript ts =3D context.newObject(TestScript.class); > ts.setId("9.1 - general info tab"); > ts.setIdForDisplay("9.1 - General Info Tab"); > > TestScriptHist tsh =3D context.newObject(TestScriptHist.class); > tsh.setDescription(Txt.getObject(context, "This script will test the > function of the General Info tab on the Master Instrument Record screen."= , > false)); > tsh.setDisabled(false); > tsh.setMajorVersion(0); > tsh.setMinorVersion(0); > tsh.setParent(ts); > tsh.setRevisionCheckIn(checkIn); > > context.commitChanges(); > > > > Is it possible that the new "circular" FK relationships are confusing > Cayenne into inserting records into the tables in the wrong order? If so, > is there a way to define the order of insertions aside from performing > frequent commits on data that should really all be part of a single > transaction? > > > Here is some log output from the server side which shows hist (revision) > records being inserted before the parent records (I've clipped some of th= e > log and highlighted the important bits): > > > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script_hist') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script_hist') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script_hist') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script_hist') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script') > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > SELECT nextval('vidval.pk_test_script') > > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > [batch bind: 1->row_number:0, 2->test_project_hist_pid:200, > 3->test_project_phase_pid:200] > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > =3D=3D=3D updated 2 rows. > I would expect to see the insertions for test_script here. > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > INSERT INTO vidval.test_script_hist (approval_pid, check_in_pid, > description_txt_pid, disabled, major_version, minor_version, pid, > prereq_txt_pid, replaced_ts, test_script_pid) VALUES (?, ?, ?, ?, ?, ?, ?= , > ?, ?, ?) > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > [batch bind: 1->approval_pid:NULL, 2->check_in_pid:201, > 3->description_txt_pid:244, 4->disabled:'false', 5->major_version:0, > 6->minor_version:0, 7->pid:200, 8->prereq_txt_pid:NULL, > 9->replaced_ts:NULL, 10->test_script_pid:202] > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > [batch bind: 1->approval_pid:NULL, 2->check_in_pid:201, > 3->description_txt_pid:270, 4->disabled:'false', 5->major_version:0, > 6->minor_version:0, 7->pid:201, 8->prereq_txt_pid:NULL, > 9->replaced_ts:NULL, 10->test_script_pid:203] > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > [batch bind: 1->approval_pid:NULL, 2->check_in_pid:201, > 3->description_txt_pid:298, 4->disabled:'false', 5->major_version:0, > 6->minor_version:0, 7->pid:202, 8->prereq_txt_pid:NULL, > 9->replaced_ts:NULL, 10->test_script_pid:201] > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > [batch bind: 1->approval_pid:NULL, 2->check_in_pid:201, > 3->description_txt_pid:255, 4->disabled:'false', 5->major_version:0, > 6->minor_version:0, 7->pid:203, 8->prereq_txt_pid:NULL, > 9->replaced_ts:NULL, 10->test_script_pid:200] > [qtp1755855970-14] INFO org.apache.cayenne.log.CommonsJdbcEventLogger - > *** error. > org.postgresql.util.PSQLException: ERROR: insert or update on table > "test_script_hist" violates foreign key constraint > "test_script_hist_test_script_pid_fkey" > Detail: Key (test_script_pid)=3D(202) is not present in table > "test_script". > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecut= orImpl.java:2182) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl= .java:1911) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:3= 38) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Sta= tement.java:2959) > at > org.apache.cayenne.access.jdbc.BatchAction.runAsBatch(BatchAction.java:12= 5) > at > org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java= :90) > at > org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryActio= n.java:97) > at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:302) > at > org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlus= hAction.java:234) > at > org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushActi= on.java:155) > at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:643) > at org.apache.cayenne.access.DataDomain$2.perform(DataDomain.java:608) > at org.apache.cayenne.access.DataDomain$2.perform(DataDomain.java:605) > at > org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(Defa= ultTransactionManager.java:53) > at > org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:605) > at > org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(Dat= aDomain.java:760) > at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:586) > at > org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:744) > at > org.apache.cayenne.access.DataContext.onContextFlush(DataContext.java:708= ) > at org.apache.cayenne.BaseContext.onSync(BaseContext.java:487) > at > org.apache.cayenne.access.ClientServerChannel.onSync(ClientServerChannel.= java:78) > at > org.apache.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.= java:43) > at > org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRe= moteService.java:134) > at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180= ) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109= ) > at > com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1669) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:61) > at > org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:= 108) > at > org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.j= ava:137) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:66) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShi= roFilter.java:449) > at > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilt= er.java:365) > at > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.j= ava:90) > at > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.jav= a:83) > at > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubj= ect.java:383) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(Abstrac= tShiroFilter.java:362) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1652) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585= ) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 143) > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:57= 7) > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.j= ava:223) > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.j= ava:1127) > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.ja= va:185) > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.ja= va:1061) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 141) > at > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextH= andlerCollection.java:215) > at > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollecti= on.java:110) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.jav= a:97) > at org.eclipse.jetty.server.Server.handle(Server.java:499) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) > at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:25= 7) > at > org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540= ) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.ja= va:635) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.jav= a:555) > at java.lang.Thread.run(Thread.java:745) > [qtp1755855970-14] INFO > org.apache.cayenne.remote.hessian.service.HessianService - Exception > processing message org.apache.cayenne.remote.SyncMessage of type > flush-cascade-sync > org.apache.cayenne.CayenneRuntimeException: [v.4.0.M2 Feb 26 2015 > 08:16:32] Commit Exception > at > org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:776) > at > org.apache.cayenne.access.DataContext.onContextFlush(DataContext.java:708= ) > at org.apache.cayenne.BaseContext.onSync(BaseContext.java:487) > at > org.apache.cayenne.access.ClientServerChannel.onSync(ClientServerChannel.= java:78) > at > org.apache.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.= java:43) > at > org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRe= moteService.java:134) > at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180= ) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109= ) > at > com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1669) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:61) > at > org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:= 108) > at > org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.j= ava:137) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:66) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShi= roFilter.java:449) > at > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilt= er.java:365) > at > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.j= ava:90) > at > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.jav= a:83) > at > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubj= ect.java:383) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(Abstrac= tShiroFilter.java:362) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1652) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585= ) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 143) > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:57= 7) > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.j= ava:223) > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.j= ava:1127) > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.ja= va:185) > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.ja= va:1061) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 141) > at > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextH= andlerCollection.java:215) > at > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollecti= on.java:110) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.jav= a:97) > at org.eclipse.jetty.server.Server.handle(Server.java:499) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) > at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:25= 7) > at > org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540= ) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.ja= va:635) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.jav= a:555) > at java.lang.Thread.run(Thread.java:745) > Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on > table "test_script_hist" violates foreign key constraint > "test_script_hist_test_script_pid_fkey" > Detail: Key (test_script_pid)=3D(202) is not present in table > "test_script". > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecut= orImpl.java:2182) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl= .java:1911) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:3= 38) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Sta= tement.java:2959) > at > org.apache.cayenne.access.jdbc.BatchAction.runAsBatch(BatchAction.java:12= 5) > at > org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java= :90) > at > org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryActio= n.java:97) > at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:302) > at > org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlus= hAction.java:234) > at > org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushActi= on.java:155) > at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:643) > at org.apache.cayenne.access.DataDomain$2.perform(DataDomain.java:608) > at org.apache.cayenne.access.DataDomain$2.perform(DataDomain.java:605) > at > org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(Defa= ultTransactionManager.java:53) > at > org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:605) > at > org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(Dat= aDomain.java:760) > at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:586) > at > org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:744) > ... 45 more > Apr 18, 2016 1:28:19 AM com.caucho.hessian.server.HessianSkeleton invoke > WARNING: org.apache.cayenne.CayenneRuntimeException: [v.4.0.M2 Feb 26 201= 5 > 08:16:32] Exception processing message > org.apache.cayenne.remote.SyncMessage of type flush-cascade-sync > org.apache.cayenne.CayenneRuntimeException: [v.4.0.M2 Feb 26 2015 > 08:16:32] Exception processing message > org.apache.cayenne.remote.SyncMessage of type flush-cascade-sync > at > org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRe= moteService.java:154) > at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180= ) > at > com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109= ) > at > com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1669) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:61) > at > org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:= 108) > at > org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.j= ava:137) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterCha= in.java:66) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShi= roFilter.java:449) > at > org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilt= er.java:365) > at > org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.j= ava:90) > at > org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.jav= a:83) > at > org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubj= ect.java:383) > at > org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(Abstrac= tShiroFilter.java:362) > at > org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequest= Filter.java:125) > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHand= ler.java:1652) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585= ) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 143) > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:57= 7) > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.j= ava:223) > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.j= ava:1127) > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.ja= va:185) > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.ja= va:1061) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:= 141) > at > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextH= andlerCollection.java:215) > at > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollecti= on.java:110) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.jav= a:97) > at org.eclipse.jetty.server.Server.handle(Server.java:499) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) > at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:25= 7) > at > org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540= ) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.ja= va:635) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.jav= a:555) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.Exception: ERROR: insert or update on table > "test_script_hist" violates foreign key constraint > "test_script_hist_test_script_pid_fkey" > Detail: Key (test_script_pid)=3D(202) is not present in table > "test_script". > at > org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRe= moteService.java:150) > ... 40 more > > >=