Skip to main content

Persistent user and service information

9 replies [Last post]
luis_teixeira
Offline
Joined: 2005-04-04

I'm designing services which must access persistent data about users and services, eventually firing rules based upon the state of each user or service. Is it a good idea to take advantage of profile CMP as defined in JAIN SLEE and implemented in Mobicents, or is it a better idea to use other solutions like relational databases or LDAP resources?

Thanks,

Luis.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
metalx
Offline
Joined: 2005-08-23

Hi!
Does anybody have any tutorial for appfuse, hibernate and struts together with mysql? I'd just need an read/add/edit/update/delete example for a table.
Thanx in advance!

ivelin
Offline
Joined: 2003-07-13

Metalx, please clarify how is your question related to Mobicents?

Ivelin

luis_teixeira
Offline
Joined: 2005-04-04

Ok, so far I have seen that ensuring the persistent state of our profiles is achievable with the current implementation of Mobicents. But regardless of that, for the requirements of my services I still find that the Profile model is rather insufficient (I'm talking about the JAIN SLEE specification and not Mobicents in particular). For example in my case I intend to map provisioning information about users and services, where each user has a customized vision of the services he has subscribed, with his own particular settings. In a relational database driven approach, that would be the equivalent to having a table for the users, a table for the services, and a N:N relationship between both, ensured by an associative entity. Are JAIN SLEE profiles able to respond to such requirements?

Thanks,

Luis Teixeira

mranga
Offline
Joined: 2003-06-06

There have been some enhancements to profiles for the 1.1 version of the Spec. I dont think this particular one is covered. Do consider posting this in the jain-slee-interest mailing list. Sounds interesting and perhaps the spec leads will tune in.

Ranga

deruelle_jean
Offline
Joined: 2003-06-24

I would suggest to take advantage of profile CMP since the mobicents (SLEE) is aimed for low latency applications, hence using LDAP or relational database can slow down the service and potentially break it if a network failure happens between mobicents and the LDAP server. Profile CMP would are currently using the jboss tree cache to store provisionning information but the jboss cache will be backed up by a dedicated mobicents relationnal database in a near future with the use of hibernate.

It might be intersting to see however how to tie mobicents to a LDAP server...

Best regards
Jean

nijie8
Offline
Joined: 2005-06-09

does that means mobicents use cache to store profile cmp data now? If that we have to use database instead until hibernate and backup are integrated.

deruelle_jean
Offline
Joined: 2003-06-24

Yes, but starting from JbossCache 1.2 (mobicents uses 1.3). You can store the cache through a JDBC CacheLoader and thus have persistent storage. I just stumbled upon this 6 hours ago. So between diapers change, I tried it out and here is how it works :
Put in your jboss-treecache-profile-service.xml (or any other treecache service you want to make persisent) the following attributes
org.jboss.cache.loader.JDBCCacheLoader
true
/
false
true

cache.jdbc.table.name=jbosscache
cache.jdbc.table.create=true
cache.jdbc.table.drop=false
cache.jdbc.fqn.column=fqn
cache.jdbc.fqn.type=varchar(255)
cache.jdbc.node.column=node
cache.jdbc.node.type=blob
cache.jdbc.parent.column=parent
cache.jdbc.driver=com.mysql.jdbc.Driver cache.jdbc.url=jdbc:mysql://localhost:3306/mobicents
cache.jdbc.user=jean
cache.jdbc.password=jean

Change the user, password, driver and url to fit your own db
and put the jdbc driver you chose in a lib directory so that jboss can load the driver (I put my jdbc driver with other jar of mobicents and it worked fine) and you're done !

Now, I wonder whether or not using hibernate because it can add overhead to storage if we have to do some mapping files etc.. ? I'm not very familiar with hibernate and how it integrates with Jboss Cache though so I can be wrong on this...

ivelin
Offline
Joined: 2003-07-13

Jean, good observations.

This is exactly what we should be using. Luis, I would recommend the following steps:

1) Take Jean's example and apply to jboss-treecache-profile-service.xml

2) Instead of MySQL, try HSQL to enable as default driver. You can use the same settings as the one configured in hsqldb-ds.xml. Make sure to use the client/server settings for HSQL instead of the direct db file access settings.

3) Write a few tests to verify that data committed via profiles can be found in the JDBC store after stopping the SLEE container.

Note: As far as Hibernate is concerned, there is no need immediate to use it as a mapping layer. If the JDBC Loader does not work for some reason, then it would make sense to write a Hibernate Cache Loader, which will use the Hibernate API to abstract out the database dialects from the Loader layer.

Ivelin

ivelin
Offline
Joined: 2003-07-13