• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

jta transaction and database

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i am trying to use jta in container managed application ,

so is it that JTA closes the database connection itself and we don't need to close the database connection explicitly..

if so in my application i am using stateless session bean and persistence unit with transaction type JTA

however i am facing problem of connection not available ... all the connection in the pool gets occupied and database throws exception telling maximum connection size reached....

i am wondering what is the problem....

if any one can help...any help would be appreciable

this is important to me..

thankyou

brajen
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How have you configured declarative security on your EJB? And what changes have you made to the configuration to ensure the container takes care of the transaction?

If done properly, you won't run out of connections to the database.

-Cameron McKenzie
 
Brajendra Mathema
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

i have injected the persistence context in my session bean as:

@PersistenceContext(unitName = "Project-PU")
private EntityManager em;




my glassfish setting under resource is as follows


General Settings

Name: mssql/db_mssql
Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerXADataSource
Resource Type: javax.sqlXADataSource




Pool Settings
Initial and Minimum Pool Size: 10 Connections
Maximum Pool Size: 100 Connections
Pool Resize Quantity: 5 Connections
Idle Timeout: 300 Seconds
Max Wait Time: 60000 Milliseconds

Connection Validation
Connection Validation: not checked(i.e disabled)
Validation Method: auto-commit(selected value)
Table Name: not selected
On Any Failure: not checked
Allow Non Component Callers: not checked


Transaction
Non Transactional Connections: Enabled
Transaction Isolation:not selected
Isolation Level: not selected


in advance tab : default values are used

so what's the problem...

any idea....
what else are the required setting for CMT in glassfish or stateless ejb class

thanks..
-brajen
 
Brajendra Mathema
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, in the above case do i have to use transaction attributes in the stateless session bean...

please give me some idea..

thankyou

brajen
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

brajen mathema wrote:hi,

i have injected the persistence context in my session bean as:

@PersistenceContext(unitName = "Project-PU")
private EntityManager em;




my glassfish setting under resource is as follows


General Settings

Name: mssql/db_mssql
Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerXADataSource
Resource Type: javax.sqlXADataSource




Pool Settings
Initial and Minimum Pool Size: 10 Connections
Maximum Pool Size: 100 Connections
Pool Resize Quantity: 5 Connections
Idle Timeout: 300 Seconds
Max Wait Time: 60000 Milliseconds

Connection Validation
Connection Validation: not checked(i.e disabled)
Validation Method: auto-commit(selected value)
Table Name: not selected
On Any Failure: not checked
Allow Non Component Callers: not checked


Transaction
Non Transactional Connections: Enabled
Transaction Isolation:not selected
Isolation Level: not selected


in advance tab : default values are used

so what's the problem...

any idea....
what else are the required setting for CMT in glassfish or stateless ejb class

thanks..
-brajen




Hello brajen mathema,

I had one suggestion on database driver configuration you selected,
can you try it with the
com.microsoft.sqlserver.jdbc.SQLServerDataSource driver.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic