Jag Bains

Ranch Hand
+ Follow
since Nov 19, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jag Bains


I have the same issue. If you have a fix, can you paste a copy of your JSP and the relevant part of your backing bean and session bean so that I can see how you managed to get it to work.

Thanks a lot
14 years ago

Not sure if this is the right forum, but I just wanted to know your ideas on the Visual Web Framework.
I have been using netbeans 6.5 and the Visual Web JSF Framework to create web site. I just downloaded Netbeans 6.7 and notice that this framework is not available when creating a new project.

Does anyone know why?

Is this framework superseded by another framework, or is there a plugin that I am not aware of?

I would appreciate your thought on this as I don't want to go down a track where in the medium term the framework becomes not supported.

14 years ago
thanks. Works a treat.

Is this the correct way to enforce pessimist locking?

I was wondering how I could implement database locking using EJBs and JPA.
I am using glassfish and MySQL and I believe I have to set up some properties in the persistence.xml, but I don't know what these are.

It would also be useful if I could specify which entities beans need this locking strategy.

The reason for the question is that I wrote a simple ejbClient that accesses a session bean which in turn adds 1 to a column in the database table using an entity manager.
The client spawns 3 threads each try to update the same row but in there own transaction. When I run the client the different threads use the same entity and hence produce the folliwng output :

What I really need is to somehow synchronise the access to the entity beans, so that only 1 client can update it at once.

The code below is of the test client

The session bean method does the following:

I would appreciate if someone could point me in the right direction.


I have the same issue. Did you get to the bottom of what was wrong?


I found out how

Needed to add :

protected SessionContext ctx;

Then to rollback


Works a treat.


I am new to J2EE v5 and I am trying to understand how CMT and JTA work

I want to rollback a transaction in Stateless SessionBean and all the documentation I have read is that I should use setRollBack on the EJBContext.

I have created a testcase where I increment a number in the DB, call the persist on the EntityManager and then try to roll it back using em.getTransaction().setRollbackOnly(); . When I do this I get returned an error

I used netbeans 6.5 to create the sessionbean and the corresponding enity

Below is my session bean

I would appreciate if someone could put me on the right track and even post an example session bean that I could use as a template.

Sorry I should have mentioned that I am using Netbeans 6.5

My JSF page is (login.jsp):

I have a webuijsf:messageGroup id="messageGroup1" on the page and I want to populate it with a message from the page bean login.java as follows:

In my loginBtn_action, I want to display a message that is displayed in messageGroup1.
What should I do to display a message from the resource bundle?
15 years ago

I have a backing been which extends AbstractPageBean.
I want to output a message from the bundle

this.info("message fro m bundle");

How do I do this?


15 years ago

Does anyone know how to configure XA datasource Orion.

I am usineg ms sql server 2000 and i need to know how to set up data-source.xml so that i can use BMT with my stateless session bean.


18 years ago

I have my log4j.jar and my log4j.properties in my Orion/lib dir.

That seems to work fine for me
18 years ago
how do i find the correct class to use for the XA data source?
I'm using MS sql server 2000.
Hi Roger,

My vender is Orion. Looking at the documentation, it states I should be setting up the datasource as:

3.5 Configuring a vendor XA DataSource for EJB or CMT usage

In order to use a vendor implementation of a XA DataSource for EJB or CMT usage, the DataSource has to be wrapped by the OrionCMTDataSource class in order for Orion to add support for distributed transactions and pooling as necessary.

This setup requires two DataSource configuration entries; one defining the vendor XA DataSource and another defining the wrapping Orion DataSource (OrionCMTDataSource) for EJB or CMT usage.

Below is an example of such a setup using Inet Opta 2000 XDataSource for MS SQL Server 7.0:

<data-sources> <!-- vendor XA DataSource -->
username="sa" password="" host="localhost" > <property name="databaseName" value="sample"/> </data-source>
<!-- Orion CMT DataSource --> <data-source name="default" location="jdbc/defaultCoreDS" class="com.evermind.sql.OrionCMTDataSource" xa-source-location="jdbc/vendorXACoreDS" schema="database-schemas/ms-sql.xml" /> </data-sources>

Listing 5: A sample XA Datasource for EJB or CMT usage DataSource entry.

The first DataSource configuration entry listed above creates a Inet Opta2000 DataSource and binds it to the JNDI location " jdbc/vendorXACoredDS". The name of the database to use is stated in a parameter name-value pair as this parameter is not part of the normal parameters defined for data-source.xml entries, but the vendor's implementation needs this value.

The second DataSource configuration entry listed above creates a OrionCMTDataSource on top of the first DataSource and binds it to the JNDI location " jdbc/defaultCoreDS". As this DataSource needs to be used on top of a existing XA DataSource, the JNDI location value of the xa-source-location attribute is given a value of " jdbc/vendorXACoredDS", which will point it to the first DataSource (see above).

The second DataSource configuration entry listed above would become the default DataSource for all applications deployed after this DataSource descriptor has been deployed as its the first DataSource listed to use the OrionCMTDataSource.

Hi Valentin,

Understand what you are saying and will change.

However, I not 100% sure this will make any difference. Its almost as if I am missing something obvious when setting up the datasource or connection or UserTransaction.