WebSphere Application Server - Hibernate as Custom Service with resource ref

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > August 2006 > Hibernate as Custom Service with resource ref





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 Hibernate as Custom Service with resource ref

2006-08-16, 7:22 pm

Hi!
I have a problem using Hibernate with Websphere. I'd like to initialize Hibernate as a custom service.
My problem: if I use container connection pool for datasource (datasource in jndi), I need a resource reference, because I canot set isolation level and authentication, but I don't know is there any way to set a resource reference to a Custom Service.

Anyway, has anybody initialized Hibernate under Websphere as custom service? I'd be very happy if somebody could give me a working example or step-by-step tutorial....

thx, Peter

2006-08-22, 7:39 pm

There is no need to define isolation properties, if you have configured it at the time of application building.
web.xml and other binding file includes that property when you deploy it to application server.
Paul Ilechko

2006-08-22, 7:39 pm

mpeter22@freemail.hu wrote:
> Hi! I have a problem using Hibernate with Websphere. I'd like to
> initialize Hibernate as a custom service. My problem: if I use
> container connection pool for datasource (datasource in jndi), I need
> a resource reference, because I canot set isolation level and
> authentication, but I don't know is there any way to set a resource
> reference to a Custom Service.
>
> Anyway, has anybody initialized Hibernate under Websphere as custom
> service? I'd be very happy if somebody could give me a working
> example or step-by-step tutorial....


What do you mean by this? I can see how you could develop a custom
service that used Hibernate to do data access (although I'm not sure
that is legal, and I don't think you can use datasources in a custom
service) but not how you would make Hibernate itself a custom service ...

You should also note the following from the WAS 6 infocenter:

The following restrictions apply to the WebSphere Application Server
custom services implementation:

* The init and shutdown methods must return control to the runtime.
* No work is dispatched into the server instance until all custom
service initialize methods return.
* The init and shutdown methods are called only once on each
service, and once for each operating system process that makes up the
server instance. File I/O is supported.
* Initialization of process level static data, without leaving the
process, is supported.
* Only JDBC RMLT (resource manager local transaction) operations
are supported. Every unit of work (UOW) must be completed before the
methods return.
* Creation of threads is not supported.
* Creation of sockets and I/O, other than file I/O, is not
supported. Running standard J2EE code, such as client code, servlets,
and enterprise beans, is not supported.
* The Java Transaction API (JTA) interface is not available. This
feature is available in J2EE server processes and distributed generic
server processes only.
* While the runtime makes an effort to call shutdown, there is no
guarantee that shutdown will be called prior to process termination.

These restrictions apply to the shutdown and init methods equally. Some
JNDI operations are available.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com