JNDI connection pooling issues

View: New views
9 Messages — Rating Filter:   Alert me  

JNDI connection pooling issues

by Alapati, Shyam Kishore :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

            We are having an issue with the jndi connection in our application. The application is running on websphere app server and connecting to oracle database. We configured a connection pool in websphere and tried connecting to it. After four or five transactions the application is running out of connections. I have kept the connection pool size as 10 in the development environment. The problem I can see here is that the grails container is not returning the connection to the websphere. Any help is appreciated

 

Thanks

Shyam

 


Re: JNDI connection pooling issues

by Luke Daley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 01/05/2008, at 12:35 AM, Alapati, Shyam Kishore wrote:

> We are having an issue with the jndi connection in our application.  
> The application is running on websphere app server and connecting  
> to oracle database. We configured a connection pool in websphere  
> and tried connecting to it. After four or five transactions the  
> application is running out of connections. I have kept the  
> connection pool size as 10 in the development environment. The  
> problem I can see here is that the grails container is not  
> returning the connection to the websphere. Any help is appreciated

I am having similar issues. After extensive Googling sometime ago,  
the consensus was that this is a bug in the ojdbc driver, which I  
don't buy (why does it only in Grails?)

LD.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Environment datasource details from service

by Ladislav Skokan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

any idea  how can I access datasource details from a service? I want to
copy data from Grails database to an another one inside a service.

Thank you, Ladislav.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Environment datasource details from service

by Jeff Brown-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, May 1, 2008 at 4:58 PM, Ladislav Skokan <lsk@...> wrote:
> Hello,
>
>  any idea  how can I access datasource details from a service? I want to
> copy data from Grails database to an another one inside a service.
>
>  Thank you, Ladislav.
>

If you declare a property in your service called "dataSource", Grails
will inject an initialized DataSource for you...

class FooService {
    def dataSource

    def doSomething() {
        def conn = dataSource.connection
        // ...
    }
}

I hope that helps.



jb
--
Jeff Brown
Director North American Operations
G2One Inc.
http://www.g2one.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Environment datasource details from service

by Ladislav Skokan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jeff,

if does not seems to work. the "dataSource" is always null.

L.

Jeff Brown napsal(a):
On Thu, May 1, 2008 at 4:58 PM, Ladislav Skokan lsk@... wrote:
  
Hello,

 any idea  how can I access datasource details from a service? I want to
copy data from Grails database to an another one inside a service.

 Thank you, Ladislav.

    

If you declare a property in your service called "dataSource", Grails
will inject an initialized DataSource for you...

class FooService {
    def dataSource

    def doSomething() {
        def conn = dataSource.connection
        // ...
    }
}

I hope that helps.



jb
  

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Re: Environment datasource details from service

by Jeff Brown-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, May 1, 2008 at 5:22 PM, Ladislav Skokan <lsk@...> wrote:
>
>  Jeff,
>
>  if does not seems to work. the "dataSource" is always null.
>
>  L.
>

Can you show me what your service class looks like?  Also, can you
show the class that is using the service?



jb

--
Jeff Brown
Director North American Operations
G2One Inc.
http://www.g2one.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Environment datasource details from service

by Ladislav Skokan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jeff,

this is my service:

class PricelistService {

    def dataSource
   
    boolean transactional = true

    def fromERPtoWeb() {
        println "!!! Info " + dataSource
       
    }

}

Invoking from controller, from list()

    def list = {

        def pricelistService = new PricelistService()
        pricelistService.fromERPtoWeb()
    ....

L.      


Jeff Brown napsal(a):
On Thu, May 1, 2008 at 5:22 PM, Ladislav Skokan lsk@... wrote:
  
 Jeff,

 if does not seems to work. the "dataSource" is always null.

 L.

    

Can you show me what your service class looks like?  Also, can you
show the class that is using the service?



jb

  

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Re: Environment datasource details from service

by burtbeckwith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You shouldn't create a new service instance:
>          def pricelistService = new PricelistService()

use dependency injection like you did for the DataSource:

      def pricelistService

      def list = {
          pricelistService.fromERPtoWeb()
      ....

and you'll get the proper singleton service instance with its dependencies
injected.

Burt


On Friday 02 May 2008 1:44:50 am Ladislav Skokan wrote:

>  Jeff,
>
>  this is my service:
>
>  class PricelistService {
>
>      def dataSource
>     
>      boolean transactional = true
>
>      def fromERPtoWeb() {
>          println "!!! Info " + dataSource
>         
>      }
>
>  }
>
>  Invoking from controller, from list()
>
>      def list = {
>
>          def pricelistService = new PricelistService()
>          pricelistService.fromERPtoWeb()
>      ....
>
>  L.      
>
>
>  Jeff Brown napsal(a):
> On Thu, May 1, 2008 at 5:22 PM, Ladislav Skokan <lsk@...> wrote:
>
>  Jeff,
>
>  if does not seems to work. the "dataSource" is always null.
>
>  L.
>
>
>
> Can you show me what your service class looks like?  Also, can you
> show the class that is using the service?
>
>
>
> jb
>
>
>
>    --------------------------------------------------------------------- To
> unsubscribe from this list, please visit:
> http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Environment datasource details from service

by Ladislav Skokan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It works now, indeed. Thank you!

L.

Burt Beckwith napsal(a):
You shouldn't create a new service instance:
  
         def pricelistService = new PricelistService()
    

use dependency injection like you did for the DataSource:

      def pricelistService

      def list = {
          pricelistService.fromERPtoWeb()
      ....

and you'll get the proper singleton service instance with its dependencies 
injected.

Burt


On Friday 02 May 2008 1:44:50 am Ladislav Skokan wrote:
  
 Jeff,

 this is my service:

 class PricelistService {

     def dataSource
    
     boolean transactional = true

     def fromERPtoWeb() {
         println "!!! Info " + dataSource
        
     }

 }

 Invoking from controller, from list()

     def list = {

         def pricelistService = new PricelistService()
         pricelistService.fromERPtoWeb()
     ....

 L.      


 Jeff Brown napsal(a):
On Thu, May 1, 2008 at 5:22 PM, Ladislav Skokan lsk@... wrote:

 Jeff,

 if does not seems to work. the "dataSource" is always null.

 L.



Can you show me what your service class looks like?  Also, can you
show the class that is using the service?



jb



   --------------------------------------------------------------------- To
unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
    



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




  

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email