From 715e500fe869badb7cb32ea37bb8cedf5be10553 Mon Sep 17 00:00:00 2001 From: quasi Date: Wed, 5 Jan 2011 16:13:27 +0000 Subject: [PATCH] Korrekturen um offene ResultSets zu verhindern git-svn-id: https://svn.libreccm.org/ccm/trunk@669 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/cms/contenttypes/GenericContact.java | 10 +++++++++- .../contenttypes/ui/GenericContactEntriesTable.java | 7 ++++++- .../cms/contenttypes/ui/GenericPersonContactTable.java | 8 +++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java index 78c0ae950..ffbc78ed7 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericContact.java @@ -109,6 +109,9 @@ public class GenericContact extends ContentPage implements collection.next(); dobj = collection.getDataObject(); + // Close Collection to prevent an open ResultSet + collection.close(); + return (GenericPerson) DomainObjectFactory.newInstance(dobj); } //return (GenericPerson) DomainObjectFactory.newInstance((DataObject)get(PERSON)); @@ -190,7 +193,12 @@ public class GenericContact extends ContentPage implements if(person != null) { GenericPersonContactCollection collection = person.getContacts(); collection.next(); - return (String) collection.getContactType(); + String contactType = (String) collection.getContactType(); + + // Close Collection to prevent open ResultSet + collection.close(); + + return contactType; } else { return null; } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java index 1a0a942aa..ae045d393 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java @@ -151,7 +151,12 @@ public class GenericContactEntriesTable extends Table implements TableActionList GenericContactEntryKeys keys = new GenericContactEntryKeys(m_contactEntry.getKey()); keys.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage()); if (keys.next()) { - return keys.getName(); + Object key = keys.getName(); + + // Close Collection to prevent open ResultSet + keys.close(); + + return key; } return m_contactEntry.getKey(); case 1: diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java index 607c90d08..2f77e1aa2 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java @@ -205,9 +205,15 @@ public class GenericPersonContactTable extends Table implements contacttypes.getRelationAttribute( m_contactCollection.getContactType(), lang))); - return contacttypes.getRelationAttribute( + + Object name = contacttypes.getRelationAttribute( m_contactCollection.getContactType(), lang).getName(); + + // Close collection to prevent open ResultSet + contacttypes.close(); + + return name; case 1: return m_contact.getTitle(); case 2: