Question about profiles

11 views
Skip to first unread message

yulian_o

unread,
Apr 19, 2011, 1:01:22 PM4/19/11
to mobicents-public
Hello
I have the following question :
As i understand profiles are not saved in memory but in some sort of
DB.
This causes the the problem when the server is restarted for example.
For example in registrating service i store the data in profile and
set timeout.
When timeout expires i delete the profile.
When the server restarts timer event does not occure.

How can i resolve this issue.
Also how can i clear the profile table?

Best regards
Yulian Oifa

Alexandre Mendonça

unread,
Apr 21, 2011, 10:56:42 AM4/21/11
to mobicent...@googlegroups.com
Hi Yulian,

You have two options:

1) Disable profile persistence, by editing ./mobicents-slee/META-INF/jboss-beans.xml:

<bean name="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig" class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
<property name="persistProfiles">false</property>
...
</bean>

- OR -

2) At service start you can clear all the profiles (using findAll() + remove(name)) or simply remove and recreate the table, it should come up clean.


As a side note, at JAIN SLEE 1.0 there was the option to have persistent timers, that would survive server restarts..In JAIN SLEE 1.1 it was deprecated but I think it still works... if you use that together with the proper Preserve Missed option (ALL), you may get your timers fired once SLEE restarts.

Hope it helps.

Regards,

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/

yulian_o

unread,
Apr 21, 2011, 12:37:21 PM4/21/11
to mobicents-public
Hello Alexandre
Thank you for your answer ,
I will prefer to keep persistance since server restart will cause less
trouble for clients ( registration will not be deleted for all but
only for those that tried
to re-register in time of restart ).

I am setting the timer in following way :

NullActivity nullActivity = nullActivityFactory.createNullActivity();
ActivityContextInterface nullActivityContextInterface =
nullACIFactory.getActivityContextInterface(nullActivity);
nullActivityContextInterface.attach(this.getSbbContext().getSbbLocalObject());

TimerOptions options = new TimerOptions();
options.setPreserveMissed(TimerPreserveMissed.ALL);
this.timerFacility.setTimer(nullActivityContextInterface, null,
System.currentTimeMillis() + expires*1000 + 100, options);

and doing the following in timer event :

public void onTIMER(javax.slee.facilities.TimerEvent event,
ActivityContextInterface aci)
{
ProfileTable profileTable = null;
try
{
profileTable=profileFacility.getProfileTable(profileTableName);
//check if exists in storage
ProfileLocalObject profileLocalObject =
profileTable.find(getProfileNameCMP());
if(profileLocalObject!=null)
{

if(((RegistrarProxyProfileCMP)profileLocalObject).getValidTill().before(new
Date()))
{
tracer.info("Registration expired for " + getProfileNameCMP());
profileTable.remove(getProfileNameCMP());
}
}
}
catch (UnrecognizedProfileTableNameException e)
{
}

aci.detach(this.getSbbContext().getSbbLocalObject());
}

But there are several problems in this case.
First of all the timer is set on null acivity , and this activity will
not exist after the restart , also sbb entity attached to null
activity will not?
Also i store the profile name in CMP field , that will not be
available.

So to make it persistant and working i need not only the timer events
be persistant , but also sbb entitites and activities.

Best regards
Yulian Oifa

On Apr 21, 4:56 pm, Alexandre Mendonça <brains...@gmail.com> wrote:
> Hi Yulian,
>
> You have two options:
>
> 1) Disable profile persistence, by editing
> ./mobicents-slee/META-INF/jboss-beans.xml:
>
> <bean name="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig"
> class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
>  <property name="persistProfiles">*false*</property>
> ...
>  </bean>
>
> - OR -
>
> 2) At service start you can clear all the profiles (using findAll() +
> remove(name)) or simply remove and recreate the table, it should come up
> clean.
>
> As a side note, at JAIN SLEE 1.0 there was the option to have persistent
> timers, that would survive server restarts..In JAIN SLEE 1.1 it was
> deprecated but I think it still works... if you use that together with the
> proper Preserve Missed option (ALL), you may get your timers fired once SLEE
> restarts.
>
> Hope it helps.
>
> Regards,
>
> --
> *Alexandre Mendonça* // JBoss R&Dhttp://ammendonca.blogspot.com/

Eduardo Martins

unread,
Apr 25, 2011, 10:17:10 AM4/25/11
to mobicent...@googlegroups.com
Timers do not survive server restart, the specification does not even
consider such concept, since activities end when SLEE reaches STOPPED
state.

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

Reply all
Reply to author
Forward
0 new messages