on 2004 Feb 13 7:32 PM
Hi,
I am trying to create a datasource for my application.
I want the isolation level to be TRANSACTION_SERIALIZABLE in the connection. But if I set the connection to TRANSACTION_SERIALIZABLE it gives me a illegalArgument exception. If I set it to default it works any idea why ?
I am using the WAS 6.30 on windows.
thanks a lot
Padmaja Ragavendra
Hi Padmaja,
please have a look at the documentation, Development Manual/Java Persistence/Locks.
Also have a look at the docu about the package
com.sap.engine.services.applocking
contained in the Documentation manual 'API reference'
and let us know if the information is not sufficient.
Again, you should stay at the default isolation level of open sql and acquire locks.
With bmp entity beans, the container does not interact between the bean and the database at all. There is no difference if you use BMP entity beans and if you send JDBC/SQLJ directly from the session bean. That's why there is no possibility to set something database related, for example about the isolation level, for BMP entity beans (there is no difference if you use BMP entity beans and if you send JDBC/SQLJ directly from the session bean)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Padmaja,
why do you need the TX_SERIALIZABLe isolation?
The right way with the Open SQL datasource is to
stay at the default isolation level - and it is the lowest one: READ_UNCOMMITED - and to lock database data on the server side using the Enqueue Server.
Remember, in general, the whole application uses the same isolation level.
Last but not least: you should not change the settings of the default data source.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katarzyna,
I am using bean managed persistence and I could not find documentation on how to use the logical locks from the enqueue server.
Most of the documents talk about container managed peristence and logical locks.
I need the isolation level to be Transaction serializable.
or atleast reapatable read.
The ejb-j2ee-engine.xml file has isolation levels for container managed beans.
How do I set these for bean managed beans?
How do I set the enqueue server isolation level to repeattable read as I understand it does not support transaction serializable
Thanks a lot for your help.
Please do let me know if you have more info on enqueue server.
thanks
Padmaja
Hi Padmaja,
this depends on how you do this and what you are using. If your program uses Open SQL, then this is surely expected to be part of the descriptors, which may collide with your program.
If you are more specific, I may be able to tell you more.
Regards,
Benny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have a Entity Bean which has Open Sql statements. I created a datasource as specified in the car rental example.
driver class = com.sap.dbtech.jdbc.DriverSapDB
driver name = SYSTEM_DRIVER
database url = jdbc:sapdb://localhost/C11?timeout=0
jdbc version = 1.x
user = sapc11db
In my code I do a lookup of the datasource
dataSource = (DataSource) ctx.lookup("jdbc/BMPEXAMPLE");
connection = _dataSource.getConnection();
when it tries to get the connection it fails.
I need the transaction isolation to be TRANSACTION_SERIALIZABLE.
So in the visual administrator-> jdbc connectors -> addtional I set the default transaction isolation
to be TRANSACTION_SERIALIZABLE.
I tried where i set the URL to be
jdbc:sapdb://localhost/C11?isolation=TRANSACTION_SERIALIZABLE&timeout=0
this did not give me any error but in the sql trace when it sets the isolationlevel it is setting it to 1.
Is there something I need to set in sapdb to get this working correctly.
thanks a lot for your help.
Please let me know if you need more details. I am very new to sapdb and the netweaver platform.
thanks
Padmaja Ragavendra
Hi Benny,
I posted a reply earlier in the day but it seems like it has not been updated.
I download the WebAs 6.30 beta version evaluation copy from the sap website and installed using default configuration.
The example I looked was the car rental example available on the sap website
http://sdn.sap.com/was6_3_beta2.
I created an example which has a session bean as a front end. This creates employees, finds and deletes employees.
The session bean initiates transactions (JTA). The session bean has the business logic call the entity bean methods for creation, searching etc.
The entity bean is a BMP. It uses a datasource and opensql to store and retrieve data from the database.
I wrote this example to test how to connect to the database using BMP and transactions.
I am using UserTransactions.
For creating the datasource I looked on the website at
"Creating a DataSource with JDBC 1.x Driver (SAP Library - J2EE Technology in SAP Web Application Server) "
The datasource is needed to connect to the database. I created it from the j2ee visual administartor.
All I wanted to check was how the connection isolation levels work with BMP and JTA transactions.(javax.sql.connection)
Are they supported in 6.30 ?
If you need more info let me know.
thanks for all your help
Padmaja
Hi Padmaja,
as I understand right, you are <b>not</b> using sneak preview for this but downloaded it from service.sap.com?
This will not work as this had some major changes you won't find out yourself.
For one thing there is a database alias you should declare for the project. Depending on your version this only can be done by rightclicking the projrct and open a new database alias xml file (sorry, but at the moment I'm not in access on a system, so cannot look up the correct name)
More about aliases you can find in the manual under:
How to transport the alias with your application is under:
ther please follow: Connectivity and Interoperability-> J2EE Connector Architecture-> Handling DataSources-> Deploying a DataSource Alias with an Application
Regards,
Benny
Hi Benny
Thanks for all the info. Your help is really appreciated.
I will try to get the alias working and let you know how that goes.
I looked at the "about tab" in my netweaver and it says sneak preview 2.0.0
Will that change things ?
Sorry about not looking up things correctly.
You have been a real help
thanks once again.
Padmaja
Hi Benny,
Here is what I tried.
Added an alias to the default datasource.
In my example now am looking up this alias for the default datasource.
When I see the default datasource's monitor I can see the connections being established.
This was with the sysDS.isolation property not set to anything.
Then I set the sysDS.isolation TRANSACTION_SERIALIZABLE.
Now my example is not working and gives a ResourceException.
Also in the Enterprise assembly I cannot add the dbpool alias connection as that feature is not available.
Do you know what the value for the sysDS.isolation should be set to?
thanks a lot for your help
Padmaja
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.