cancel
Showing results for 
Search instead for 
Did you mean: 

Connections not closed with sap4rails/saprfc

Former Member
0 Kudos

Hi,

I am running into another problem. If I use sap4rails with the old saprfc, the connections seem not to be closed, only a restart of mongrel closes them. I have tried everything, calling close() of the function module, calling close() of the class that holds the function module (inherited from SAP4Rails:Base), setting both to nil (which shouldn't work because of the GC). I also altered SAP::RFC with calling self.close() at the end of the call() method. The connections seem to keep open afterwards and therefore I run into a problem after calling it for the 100th time. I don't want to change the number of concurrent function calls at the SAP system, to hold the workload low.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This does not sound good.

What sort of traffic are you putting through your site - are you doing some volume testing, or is this happening over an extended period of time?

How sap4rails works is that each time the SAP4Rails subclassed model is loaded, a new connection is created, and all the Function Modules are automatically loaded/cached. From what you are saying, it implies that every hit on your web server is causing this to happen. This maybe a function of how Mongrel works, or a larger symptom of Rails, that the class is being reloaded on every hit.

please talk through what you are doing - if you can distill it down to a simple test case that you can pass over to me, even better.

Piers Harding.

Former Member
0 Kudos

I was thinking some more about this, and wondering whether you are running the Rails application in Development of Production mode?

Development mode forces a reload of modules every request, which would definitely cause a problem such as you are seeing.

Piers.

Former Member
0 Kudos

Hi,

thank you very much! This solved my problem. I am new to the Ruby and Rails and didn't know these differences between Development and Production mode.

Answers (0)