# WebLogic Persistence issue.

**URL:** <https://community.f5.com/t/weblogic-persistence-issue/39108>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [March 12, 2010, 8:56pm UTC](https://community.f5.com/t/weblogic-persistence-issue/39108 "2010-03-12T20:56:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moose224\_63566](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@Moose224\_63566](https://community.f5.com/u/Moose224_63566)\
**Post date:** [March 12, 2010, 8:56pm UTC](https://community.f5.com/t/weblogic-persistence-issue/39108/1 "2010-03-12T20:56:23Z")

</div>

We have deployed several BEA WebLogic applications, all with JSessionID persistence, without issue.

Now we are deploying a new Application using a renamed JSessionID cookie for persistence, and we are seeing issues with finding the value in our persistence table consistently. Watching communication, we see will see a number of requests hit the iRule we are using, and find the persistence record, and persist. Every now and then it will not find a value for persistence, and load balance to an improper server. Anyone have any ideas?

Note: We are also doing some static content separation to an Apache farm.

when HTTP\_REQUEST {

if { [matchclass [HTTP::path] ends\_with $::WLfiles ] } {

WebLogic Request

pool weblogic\_pool

if { [HTTP::cookie exists “CookieID”] } {

set PersistValue [persist lookup uie [HTTP::cookie “CookieID”]]

if {$PersistValue eq “”} {

log local0.info “no persistance found, even though cookie exists”

}

persist uie [HTTP::cookie “CookieID”]

}

} else {

Static Request

pool Static-Content\_pool

}

}

when HTTP\_RESPONSE {

if { [HTTP::cookie exists “CookieID”] } {

persist add uie [HTTP::cookie “CookieID”] 3600

}

}

---

<div class="post-metadata">

**Author:** ![JRahm](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jrahm/32/3327_2.png) [@JRahm](https://community.f5.com/u/JRahm)\
**Post date:** [March 13, 2010, 4:58am UTC](https://community.f5.com/t/weblogic-persistence-issue/39108/2 "2010-03-13T04:58:10Z")

</div>

what is the format of your cookie? It’s been awhile, but in an environment I’ve worked in it was \<52characterString\>!! or something like that. Sometimes, the server IDs would change coming back from the app, tanking persistence when using the whole cookie. I stripped off the serverID stuff and just went with the ID itself using getfield:

[getfield [HTTP::cookie “CookieID”] “!” 1]

Not sure this is your same scenario, but something to consider.

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [November 16, 2011, 5:23pm UTC](https://community.f5.com/t/weblogic-persistence-issue/39108/3 "2011-11-16T17:23:23Z")

</div>

Our Weblogic persistence uses a cookie insert persistence method. This seems to be what the F5 guide and the BEA Weblogic template uses as well.

It works \_most\_ of the time. However, we do see entries in the weblogic logs that indicate that from time to time a request comes in and falls on the wrong server (not the primary or secondary weblogic server). That puts weblogic into a recovery state to reconstruct the session on the server that it arrived on.

Sounds very similar to the situation Moose reports above. Thanks for the code snippet. I think I can use it for a variation to log when this occurs and capture some information to try to determine what happened.

I’d also be interested in anyone who has found a solution to this situation. Save me the work of trying figure this one out-- guessing it will take a bit to do that.

Thanks!

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [November 16, 2011, 8:23pm UTC](https://community.f5.com/t/weblogic-persistence-issue/39108/4 "2011-11-16T20:23:45Z")

</div>

Hi Brad,

On a tangent, you could try an iRule which uses the primary and secondary session mirroring and tokens on Weblogic to persist clients:

[http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1171255/showtab/groupforums/Default.aspx1172496](http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1171255/showtab/groupforums/Default.aspx1172496)

Make sure to add a OneConnect profile to the virtual server.

Aaron
