JRuby on Rails and Thread Safety

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    4 Favorites

    JRuby on Rails and Thread Safety - Presentation Transcript

    1. JRuby on Rails and Thread Safety Naoto Takai Akasaka.rb / Itochu Techno-Solutions Corp. 29 November 2008
    2. ‣ JRuby on Rails and Thread Safety ‣ ActiveRecord and Connection Pooling ‣ JNDI and Connection Pooling
    3. ‣ JRuby on Rails and Thread Safety ‣ ActiveRecord and Connection Pooling ‣ JNDI and Connection Pooling
    4. Ruby on Rails 2.2 Release Notes
    5. Ruby on Rails 2.1 or Prior Ruby Process Rails Instance Ruby Process Rails Database Instance Ruby Process Rails Instance
    6. JRuby on Rails 2.1 or Prior Thread JRuby Rails Instance Thread JRuby Rails Database Instance Thread JRuby Rails Instance Thread
    7. One JRuby Instance, One Database Connection JRuby Thread Rails Database Instance
    8. JRuby on Rails 2.2 or Later Thread JRuby Rails Instance Thread JRuby Connection Rails Database Instance Pool Thread JRuby Rails Instance Thread
    9. One JRuby Instance, Many Database Connections Thread JRuby Rails Database Instance Thread You need less JRuby instances per database connections.
    10. ‣ JRuby on Rails and Thread Safety ‣ ActiveRecord and Connection Pooling ‣ JNDI and Connection Pooling
    11. ActiveRecord Connection Pool ActiveRecord::Base.establish_connection( :adapter => \"mysql\", :username => \"root\", :database => \"database\", :pool => 5 )
    12. Demo Code 10.times do Thread.new do ActiveRecord::Base.connection_pool \\ .with_connection do |c| ret = c.execute(\"select connection_id()\") puts \"Connection ID: %s\" % ret.fetch_row end end end
    13. ActiveRecord Connection Pooling (1) Check-out Connect Connection ActiveRecord Database Pool Connection
    14. ActiveRecord Connection Pooling (2) Check-out Connection ActiveRecord Database Pool Connection
    15. ActiveRecord Connection Pooling (3) Wait Check-out Connection ActiveRecord Database Pool Connection Check-out Check-in ActiveRecord
    16. ‣ JRuby on Rails and Thread Safety ‣ ActiveRecord and Connection Pooling ‣ JNDI and Connection Pooling
    17. ‣ JNDI (Java Naming and Directory Service) ‣ Binding a name to an object. ‣ Look-up the object by name.
    18. Using JNDI Look-up ActiveRecord::Base.establish_connection( :adapter => \"jdbc\", :jndi => \"jdbc/MySQL\", :driver => \"com.mysql.jdbc.Driver\", :pool => 5 )
    19. JNDI Look-up Look-up Reference Connection Client Database Pool Data Source
    20. Java EE Application Server Connection Pooling Connect or Check-out Reconnect ActiveRecord App Server ActiveRecord Connection Connection Pool Pool Connection Connection Check-in Disconnect Database

    + Naoto TakaiNaoto Takai, 7 months ago

    custom

    1924 views, 4 favs, 2 embeds more stats

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 1924
      • 1740 on SlideShare
      • 184 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 31
    Most viewed embeds
    • 183 views on http://recompile.net
    • 1 views on http://www.slideshare.net

    more

    All embeds
    • 183 views on http://recompile.net
    • 1 views on http://www.slideshare.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel

    Categories