Thread-topic: [eclipselink-users] WebSphere datasource note working for insert update queries.
Hello Chris,
I have added the transaction-type=”JTA”
now it’s not giving me the connection error but I my record a not able to flush
into table. I am not getting any error on websphere console. Also I am not
using explicit flush method in the code for insert I am just using persist
method.
Thanks & Regards,
Atish
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Christopher Delahunt Sent: Tuesday, September 28, 2010
8:36 PM To: EclipseLink User Discussions Subject: Re: [eclipselink-users]
WebSphere datasource note working for insert update queries.
Hello Atish,
Which version of Websphere are you using? Try adding
transaction-type="JTA" to your persistence-unit, as it could be that
Websphere is not passing this in when creating the persistence unit, causing
the jta-data-source to be ignored.
Best Regards,
Chris
On 28/09/2010 10:04 AM, Atish Potdar wrote:
Hello Chris,
Thanks for quick reply.
The application is build using EJB3. The
application is getting EntityManager using Annotation @PersistenceContext(unitName = "BgPU") in
stateless bean. We are using below persistence.xml in our application and
datasource is configured in WebSphere. There are no explicit properties set in
persistence.xml. The same application is working on Glassfish.
The error indicates that there is no URL and no classname for the driver- it is
attempting to use a DefaultConnector which creates
connections itself instead of obtaining them from a datasource.
How are you obtaining the EntityManager and its factory, and could you have
overridden these settings by passing in null for these properties? As the
login occurs only once, are you sure you are using the same persistence unit
with the same settings when reading as when writing? What are the
settings used in the persistence.xml?
Best Regards,
Chris
On 28/09/2010 7:23 AM, Atish Potdar wrote:
Hi Group,
I have configured datasource in WebSphere to connect
to DB2 and using it in my J2EE application. The same datasource has been configured
in Persistence,xml. When I run the application then it can read and display the
data but when I tried to create or update records then it throws following
error. Can any body please advice on this?
Exception Description: Unable to
acquire a connection from driver [null], user [null] and URL [null].
Verify that you have set the expected driver class and URL. Check your
login, persistence.xml or sessions.xml resource. The jdbc.driver property
should be set to a class that is compatible with your database platform
at
org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:375)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:90)
at
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:231)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:263)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:135)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:187)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:175)
at com.fundamo.core.DefaultEntityManagerResolver.setEntityManager(DefaultEntityManagerResolver.java:44)
…………
……….
Thanks & Regards,
Atish
-**************Nihilent***************
" *** All information contained in this communication is confidential, proprietary, privileged
and is intended for the addressees only. If youhave received this E-mail in error please notify
mail administrator by telephone on +91-20-39846100 or E-mail the sender by replying to
this message, and then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination,publication, transfer or use of the contents of this communication,
with or without modifications is punishable under the relevant law.
Nihilent has scanned this mail with current virus checking technologies. However, Nihilent makes no
representations or warranties to the effect that this communication is virus-free.
Nihilent reserves the right to monitor all E-mail communications through its Corporate Network. *** "
-**************Nihilent***************
" *** All information contained in this communication is confidential, proprietary, privileged
and is intended for the addressees only. If youhave received this E-mail in error please notify
mail administrator by telephone on +91-20-39846100 or E-mail the sender by replying to
this message, and then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination,publication, transfer or use of the contents of this communication,
with or without modifications is punishable under the relevant law.
Nihilent has scanned this mail with current virus checking technologies. However, Nihilent makes no
representations or warranties to the effect that this communication is virus-free.
Nihilent reserves the right to monitor all E-mail communications through its Corporate Network. *** "
*************************************************************************-