cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject [2/2] cayenne git commit: CAY-2089 HTTP connections aren't always closed in new ROP implementation
Date Thu, 02 Jun 2016 13:35:00 GMT
CAY-2089 HTTP connections aren't always closed in new ROP implementation


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/f5ae597e
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/f5ae597e
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/f5ae597e

Branch: refs/heads/master
Commit: f5ae597e9d48185d8f6e77223be05d44f7cf1c49
Parents: 5943d5b
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Thu Jun 2 16:32:41 2016 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Thu Jun 2 16:32:41 2016 +0300

----------------------------------------------------------------------
 .../apache/cayenne/rop/ProxyRemoteService.java   | 19 ++++++++++++-------
 docs/doc/src/main/resources/RELEASE-NOTES.txt    |  1 +
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/f5ae597e/cayenne-client/src/main/java/org/apache/cayenne/rop/ProxyRemoteService.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/rop/ProxyRemoteService.java b/cayenne-client/src/main/java/org/apache/cayenne/rop/ProxyRemoteService.java
index 57d4650..6a0a8a6 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/rop/ProxyRemoteService.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/rop/ProxyRemoteService.java
@@ -24,6 +24,7 @@ import org.apache.cayenne.remote.RemoteService;
 import org.apache.cayenne.remote.RemoteSession;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.rmi.RemoteException;
 
 public class ProxyRemoteService implements RemoteService {
@@ -39,24 +40,28 @@ public class ProxyRemoteService implements RemoteService {
 
     @Override
     public RemoteSession establishSession() throws RemoteException {
-        try {
-            return serializationService.deserialize(ropConnector.establishSession(), RemoteSession.class);
+        try (InputStream is = ropConnector.establishSession()) {
+            return serializationService.deserialize(is, RemoteSession.class);
         } catch (IOException e) {
-            throw new RemoteException(e.getMessage());
+            throw new RemoteException(e.getMessage(), e);
         }
     }
 
     @Override
     public RemoteSession establishSharedSession(String name) throws RemoteException {
-        try {
-            return serializationService.deserialize(ropConnector.establishSharedSession(name),
RemoteSession.class);
+        try (InputStream is = ropConnector.establishSharedSession(name)) {
+            return serializationService.deserialize(is, RemoteSession.class);
         } catch (IOException e) {
-            throw new RemoteException(e.getMessage());
+            throw new RemoteException(e.getMessage(), e);
         }
     }
 
     @Override
     public Object processMessage(ClientMessage message) throws RemoteException, Throwable
{
-        return serializationService.deserialize(ropConnector.sendMessage(serializationService.serialize(message)),
Object.class);
+        try (InputStream is = ropConnector.sendMessage(serializationService.serialize(message)))
{
+            return serializationService.deserialize(is, Object.class);
+        } catch (IOException e) {
+            throw new RemoteException(e.getMessage(), e);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f5ae597e/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index a7e189e..0c9ae04 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -33,6 +33,7 @@ CAY-2080 Cayenne doesn't pick up reverse engineering file changes
 CAY-2084 ObjectIdQuery - no cache access polymorphism
 CAY-2086 SelectById.selectFirst stack overflow
 CAY-2087 PostCommitFilter is confused about changes made by Pre* listeners
+CAY-2089 HTTP connections aren't always closed in new ROP implementation
 
 ----------------------------------
 Release: 4.0.M3


Mime
View raw message