Partitioning table

65 views
Skip to first unread message

Mark

unread,
Jan 12, 2017, 4:24:27 AM1/12/17
to dcm4che
Hi All,

I have this scenario:
  • dcm4chee-2.17.3-psql
  • PostgreSQL 9.1
  • jdk 7
This dcm4chee will have to manage a large number of studies. To simplify the management, I thought of trying to partition the table studies.

But dcm4chee throw an exception when it receives the studies:

2017-01-11 17:28:33,470 INFO  AE_MAC->DCM4CHEE (TCPServer-1-1) [org.dcm4chex.archive.ejb.session.StorageBean] inserting instance FileMetaInfo[uid=1.3.6.1.4.1.16978.2.57456732426.4501713.5627.3
    class=1.2.840.10008.5.1.4.1.1.1/Computed Radiography Image Storage
    ts=1.2.840.10008.1.2.1/Explicit VR Little Endian
    impl=1.2.40.0.13.1.1.1-dcm4che-1.4.33]
2017-01-11 17:28:33,480 INFO  AE_MAC->DCM4CHEE (TCPServer-1-1) [org.dcm4chex.archive.ejb.entity.PatientBean] Created Patient[pk=9, pid=12345, issuer=null, name=PINCO^PALLINO^^^]
2017-01-11 17:28:33,494 WARN  AE_MAC->DCM4CHEE (TCPServer-1-1) [org.dcm4chex.archive.ejb.session.StorageBean] inserting records for instance[uid=1.3.6.1.4.1.16978.2.57456732426.4501713.5627.3] failed: null
2017-01-11 17:28:33,495 WARN  AE_MAC->DCM4CHEE (TCPServer-1-1) [org.dcm4chex.archive.dcm.storescp.StoreScpService] failed to update DB with entries for received 2017/1/11/17/B1EC96B2/B1EC96B3/B1EC96B4 - retry
org.dcm4che.net.DcmServiceException: java.lang.NullPointerException
    at org.dcm4chex.archive.ejb.session.StorageBean.store(StorageBean.java:250)
    at org.dcm4chex.archive.ejb.session.StorageBean.store(StorageBean.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:960)
    at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    at com.sun.proxy.$Proxy257.store(Unknown Source)
    at org.dcm4chex.archive.dcm.storescp.StoreScp.updateDB(StoreScp.java:1100)
    at org.dcm4chex.archive.dcm.storescp.StoreScp.doActualCStore(StoreScp.java:714)
    at org.dcm4chex.archive.dcm.storescp.StoreScp.doCStore(StoreScp.java:471)
    at org.dcm4che.net.DcmServiceBase.c_store(DcmServiceBase.java:116)
    at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:230)
    at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
    at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:164)
    at org.dcm4cheri.server.DcmHandlerImpl.handle(DcmHandlerImpl.java:249)
    at org.dcm4cheri.server.ServerImpl.run(ServerImpl.java:288)
    at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
    at org.dcm4cheri.util.LF_ThreadPool$1.run(LF_ThreadPool.java:221)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at org.dcm4chex.archive.ejb.session.StorageBean.getPatient(StorageBean.java:548)
    at org.dcm4chex.archive.ejb.session.StorageBean.coerceStudyIdentity(StorageBean.java:539)
    at org.dcm4chex.archive.ejb.session.StorageBean.getStudy(StorageBean.java:493)
    at org.dcm4chex.archive.ejb.session.StorageBean.getSeries(StorageBean.java:459)
    at org.dcm4chex.archive.ejb.session.StorageBean.store(StorageBean.java:219)
    ... 47 more


I created
the partition by using the following script,
to divide the studies depending on the creation date:


CREATE TABLE study_2011 ( CHECK ( STUDY_DATETIME >= '20110101' AND STUDY_DATETIME < '20120101' )
) INHERITS (study);


CREATE RULE study_2011 AS ON INSERT TO study
WHERE ( study_datetime >= '20110101' AND study_datetime < '20120101' ) DO INSTEAD INSERT INTO
study_2011 VALUES
(NEW.pk,
NEW.patient_fk,
NEW.accno_issuer_fk,
NEW.study_iuid,
NEW.study_id,
NEW.study_datetime,
NEW.accession_no,
NEW.ref_physician,
NEW.ref_phys_fn_sx,
NEW.ref_phys_gn_sx,
NEW.ref_phys_i_name,
NEW.ref_phys_p_name,
NEW.study_desc,
NEW.study_custom1,
NEW.study_custom2,
NEW.study_custom3,
NEW.study_status_id,
NEW.mods_in_study,
NEW.cuids_in_study,
NEW.num_series,
NEW.num_instances,
NEW.ext_retr_aet,
NEW.retrieve_aets,
NEW.fileset_iuid,
NEW.fileset_id,
NEW.availability,
NEW.study_status,
NEW.checked_time,
NEW.created_time,
NEW.updated_time,
NEW.study_attrs);


CREATE INDEX patient_fk_2011 ON study_2011(patient_fk);
CREATE INDEX accno_issuer_fk_2011 ON study_2011(accno_issuer_fk);
CREATE UNIQUE INDEX study_iuid_2011 ON study_2011(study_iuid);
CREATE INDEX study_id_2011 ON study_2011(study_id);
CREATE INDEX study_datetime_2011 ON study_2011(study_datetime);
CREATE INDEX accession_no_2011 ON study_2011(accession_no);
CREATE INDEX ref_physician_2011 ON study_2011(ref_physician);
CREATE INDEX ref_phys_fn_sx_2011 ON study_2011(ref_phys_fn_sx);
CREATE INDEX ref_phys_gn_sx_2011 ON study_2011(ref_phys_gn_sx);
CREATE INDEX ref_phys_i_name_2011 ON study_2011(ref_phys_i_name);
CREATE INDEX ref_phys_p_name_2011 ON study_2011(ref_phys_p_name);
CREATE INDEX study_desc_2011 ON study_2011(study_desc);
CREATE INDEX study_custom1_2011 ON study_2011(study_custom1);
CREATE INDEX study_custom2_2011 ON study_2011(study_custom2);
CREATE INDEX study_custom3_2011 ON study_2011(study_custom3);
CREATE INDEX study_status_id_2011 ON study_2011(study_status_id);
CREATE INDEX study_checked_2011 ON study_2011(checked_time);
CREATE INDEX study_created_2011 ON study_2011(created_time);
CREATE INDEX study_updated_2011 ON study_2011(updated_time);
CREATE INDEX study_status_2011 ON study_2011(study_status);

There is someone who is using dcm4chee with partitioned tables on postgresql?

endocrin...@gmail.com

unread,
Jan 16, 2017, 4:43:56 PM1/16/17
to dcm4che
My experience is to avoide java 1.7 or 1.8
Install oracle java 1.6 and make it default
jp

Mark

unread,
Jan 19, 2017, 3:53:57 AM1/19/17
to dcm4che
Hi jp

in this installation if the study table is not partitioned the dcm4chee works perfectly so I think the problem is not the java version.
Reply all
Reply to author
Forward
0 new messages