Skip to main content

Accessing Data Sources in SBB's

2 replies [Last post]
Joined: 2005-04-04
Points: 0

I have a question that I hope is not too philosophical :) Is it possible and/or legitimate to access a database resource directly from an SBB without involving resource adaptors for such? For example I have a MySQL database that I wish to access from an SBB component. With regular java classes I would use a JDBC connector wich I would use to pass queries and to put and retrieve information.


Luis Teixeira

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-01-18
Points: 0

Yes, you can access datasource directly from a SBB.

For example:
try {
String s = "java:/PostgresqlLocal";
InitialContext initialcontext = new InitialContext();

PG = (DataSource) initialcontext.lookup(s);
connection = PG.getConnection();
} catch (Exception exception1) {

Joined: 2003-07-13
Points: 0

I will respond to the philosophical side of the question. JDBC is typically with response time in seconds. SLEE transactions are expected to complete within 100ms. Hence it is generally undesireable to use JDBC directly from SBBs.

So the question is how to add J2EE type of functionality without breaking the SLEE expecations. This a best practices discussion.

One option seems to be recommending the usage of profiles for storing persistent data. The SLEE implementations have a good chance of optimizing performance of profile tables.

Another option could be specialized RAs, which take SLEE events and spawn JDBC type of requests asyncronously. When results are available, they'd send back an event to the inquiering SBB. This pattern matches well the SIP protocol semantics.

Other ideas?