|
Home > Archive > BizTalk Server General > April 2006 > Enterprise Library Caching in Pipeline Component
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Enterprise Library Caching in Pipeline Component
|
|
| TO_BizTalker 2006-04-18, 12:46 am |
| Hi there:
I have developed a pipeline component that promotes some properties in
the message context based on information read from the database. The
idea is that each incoming message is taged (by setting the promoted
context property value) with routing/processing information retrieved
from database based on the message namespace. These messages are then
routed to appropriate orchestrations subscribing to the messages based
on the routing/processing information. This part works very fine. I
developed a helper library to implement the plumbing and the pipeline
component just calls methods on the types.
To enhance the performance, I introduced Microsoft Practices and
Patterns Enterprise Library (EL) Caching application block. The
routing/processing information once retrieved from the database is to
be cached to enhance the performance. But the trouble is that I get an
error while trying to create/get the cache manager. The error message
that I get is very vague. It says something like "failed to create
CacheManager.I have drilled down and found out that it fails on
creating the xml serializer instance. (I think something to do with
creating temporary JITed pCode).
If I call the same library from other windows application, it works
very fine. I am confused as what's going wrong here.
What is your idea of introducing caching at AppDomain level that you
mentioned in your post.
I will appreicate any help.
Thank you,
Inam Haq
<Inam dot Haq at ravianconsulting dot com>
| |
| Scott Colestock 2006-04-18, 12:46 am |
| Is this BizTalk 2004? You might be running into the "classic" issue where
your assembly is loaded from a specific location, but a chunk of code is
attempting to do XmlSerializer work on a class that is also deployed in the
GAC. You wind up with type identity issues, and you see invalid cast
exceptions at the point you deserialize.
I don't know of a good way around this, to be honest. Perhaps someone else
can comment, or perhaps my speculation is incorrect!
Scott Colestock
www.traceofthought.net
"TO_BizTalker" <MeTechee@gmail.com> wrote in message
news:1144902426.457570.173430@z34g2000cwc.googlegroups.com...
> Hi there:
>
> I have developed a pipeline component that promotes some properties in
> the message context based on information read from the database. The
> idea is that each incoming message is taged (by setting the promoted
> context property value) with routing/processing information retrieved
> from database based on the message namespace. These messages are then
> routed to appropriate orchestrations subscribing to the messages based
> on the routing/processing information. This part works very fine. I
> developed a helper library to implement the plumbing and the pipeline
> component just calls methods on the types.
>
> To enhance the performance, I introduced Microsoft Practices and
> Patterns Enterprise Library (EL) Caching application block. The
> routing/processing information once retrieved from the database is to
> be cached to enhance the performance. But the trouble is that I get an
> error while trying to create/get the cache manager. The error message
> that I get is very vague. It says something like "failed to create
> CacheManager.I have drilled down and found out that it fails on
> creating the xml serializer instance. (I think something to do with
> creating temporary JITed pCode).
>
> If I call the same library from other windows application, it works
> very fine. I am confused as what's going wrong here.
>
> What is your idea of introducing caching at AppDomain level that you
> mentioned in your post.
>
> I will appreicate any help.
>
> Thank you,
>
> Inam Haq
>
> <Inam dot Haq at ravianconsulting dot com>
>
| |
| Scott Colestock 2006-04-18, 12:46 am |
| (to be clearer - your assembly is loaded from a specific non-gac location,
and a chunk of code is attempting to do xmlserializer work with a class that
is within the loaded assembly AND within the same assembly but deployed to
the gac)
"Scott Colestock" <scolestock@community.nospam> wrote in message
news:Os8oheyXGHA.1196@TK2MSFTNGP03.phx.gbl...
> Is this BizTalk 2004? You might be running into the "classic" issue where
> your assembly is loaded from a specific location, but a chunk of code is
> attempting to do XmlSerializer work on a class that is also deployed in
> the GAC. You wind up with type identity issues, and you see invalid cast
> exceptions at the point you deserialize.
>
> I don't know of a good way around this, to be honest. Perhaps someone
> else can comment, or perhaps my speculation is incorrect!
>
> Scott Colestock
> www.traceofthought.net
>
>
> "TO_BizTalker" <MeTechee@gmail.com> wrote in message
> news:1144902426.457570.173430@z34g2000cwc.googlegroups.com...
>
>
| |
| TO_BizTalker 2006-04-18, 12:46 am |
| Hi Scott:
Thanks for the response.
I am using BizTalk 2004.
Actually, the custom pipeline component is GAC'ed which calls another
custom library (also strong named and GAC'ed). This library calls
Microsoft Practices and Patterns Ent. Lib.'s caching application block.
The Ent. Lib. dlls were strong named but not GAC'ed. Now I have tried
GAC'ing some of its dll (that my library refers to in the code). But no
luck, I get a different error though:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory" threw an
exception.
The earlier error was:
There was an error reflecting type
'Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings'.
Any clues?
thanks
Inam.
www.RavianConsulting.com
Scott Colestock wrote:[vbcol=seagreen]
> (to be clearer - your assembly is loaded from a specific non-gac location,
> and a chunk of code is attempting to do xmlserializer work with a class that
> is within the loaded assembly AND within the same assembly but deployed to
> the gac)
>
> "Scott Colestock" <scolestock@community.nospam> wrote in message
> news:Os8oheyXGHA.1196@TK2MSFTNGP03.phx.gbl...
| |
| Scott Colestock 2006-04-18, 12:46 am |
| Ahhh, well the issue might very well be that your custom pipeline component
is in the gac. You want to put it in \program files\microsoft biztalk
server 2004\pipeline components. (You might already have it there - but it
should be there exclusively.)
Jon wrote about this awhile back -
http://www.masteringbiztalk.com/blo...6478d7c1bd.aspx
Scott Colestock
www.traceofthought.net
"TO_BizTalker" <MeTechee@gmail.com> wrote in message
news:1144965094.773515.75200@e56g2000cwe.googlegroups.com...
> Hi Scott:
>
> Thanks for the response.
>
> I am using BizTalk 2004.
> Actually, the custom pipeline component is GAC'ed which calls another
> custom library (also strong named and GAC'ed). This library calls
> Microsoft Practices and Patterns Ent. Lib.'s caching application block.
> The Ent. Lib. dlls were strong named but not GAC'ed. Now I have tried
> GAC'ing some of its dll (that my library refers to in the code). But no
> luck, I get a different error though:
>
> The type initializer for
> "Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory" threw an
> exception.
>
> The earlier error was:
>
> There was an error reflecting type
> 'Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings'.
>
> Any clues?
>
> thanks
>
> Inam.
> www.RavianConsulting.com
>
> Scott Colestock wrote:
>
| |
| TO_BizTalker 2006-04-27, 7:25 am |
| OK, after a lot of hit-and-trial, I am able to get rid of all the
errors finally: I ended up GACing the whole Ent. Lib.
thanks Scott for the lead to GACing issue. I unGACed the pipeline
component but it didn't help. Just the error message changed. Then I
tried a lot of different combinations turning 'copy local' to the
references in projects on and off, GACing helper assemblies etc. But
finally, what combination worked is:
Pipeline component OUT of GAC
Helper Assembly IN GAC
Ent. Lib. IN GAC
'Copy local' property of the Reference to helper assembly from pipeline
component project = false
'Copy local' property of the Reference to Ent. Lib. assemblies from
helper assembly project = false
The only thing wrong now is that I can't step through the code of the
helper assembly in debug mode (although it is compiled in debug mode).
I can step through the pipeline component code, but the calls to helper
assembly types/methods just 'step over' even if I say 'step in'.
thanks for all the help.
Thank you,
Inam.
www.RavianConsulting.com
| |
|
|
TO_BizTalker wrote:
> OK, after a lot of hit-and-trial, I am able to get rid of all the
> errors finally: I ended up GACing the whole Ent. Lib.
>
> thanks Scott for the lead to GACing issue. I unGACed the pipeline
> component but it didn't help. Just the error message changed. Then I
> tried a lot of different combinations turning 'copy local' to the
> references in projects on and off, GACing helper assemblies etc. But
> finally, what combination worked is:
>
> Pipeline component OUT of GAC
> Helper Assembly IN GAC
> Ent. Lib. IN GAC
> 'Copy local' property of the Reference to helper assembly from pipeline
> component project = false
> 'Copy local' property of the Reference to Ent. Lib. assemblies from
> helper assembly project = false
>
> The only thing wrong now is that I can't step through the code of the
> helper assembly in debug mode (although it is compiled in debug mode).
> I can step through the pipeline component code, but the calls to helper
> assembly types/methods just 'step over' even if I say 'step in'.
>
> thanks for all the help.
>
> Thank you,
>
> Inam.
> www.RavianConsulting.com
You can try to open the EntLib assemblies in another instance of VS and
then attach to the BT Process and debug them.
I had this trouble before and it worked for me.
Avi.
|
|
|
|
|