Castle Windsor & WCF Singleton lifestyle - could it be causing a bug?

51 views
Skip to first unread message

Core Studio

unread,
Nov 20, 2016, 6:43:38 AM11/20/16
to Castle Project Users

Hi,


I am working on a project involving financial transactions.


There can be any number of transactions coming in at the same time.


The problem is that, it seems as though, in a few cases, the transactions are being "mixed up", in an unpredictable way. I don't know if it's a result of our "bad" Lifestyle choices for Castle Windsor or there is other code causing it.


Would like to clear the air on Castle Windsor.


The logging shows that sometimes a particular request will be mixed up with a different response.


I know...Scares us too!


Main technology used is C# 4, Net 4.5, WCF, Castle Windsor


It is structured as follows:

  1. There are incoming transactions, so services should always be up
  2. There are 3 main services
  3. Service A - Singleton Lifestyle - instantiates a client to Service B using the ChannelFactory. Can spawn up to 3 threads.
  4. Service B - Singleton Lifestyle - uses a service reference, proxy client to Service C
  5. Service C - Singleton Lifestyle - connects externally to some API
+-----------------------+              +-----------------------+                  +-----------------------+
|                       |              |                       |                  |                       |
|                       |              |                       |                  |                       |
| [WCF Service  A]      |              | [WCF Service  B]      |                  | [WCF Service  C]      |
| Instantiates a        +------------->+ Instantiates a        +----------------> | Connects to an external
| client to B using     |              | client to C using     |                  | RESTful API           |
| ChannelFactory        |              | a serivice referece   |                  | (Singleton Lifestyle) |
| (Singleton Lifestyle) |              | to C                  |                  |                       |
|                       |              | (Singleton Lifestyle) |                  |                       |
|                       |              |                       |                  |                       |
+-----------------------+              +-----------------------+                  +-----------------------+

Hope someone can confirm if our implementation is a possible cause of the bugs.

Thanks!

TK
Reply all
Reply to author
Forward
0 new messages