Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 25

Displaying posts with tag: connector/j (reset)

Connector/J 5.1.30 is out with Fabric support
Employee +0 Vote Up -0Vote Down

Today marks the release of several exciting pieces of software from Oracle. In addition to MySQL server 5.7.4 DMR, MySQL Fabric is out as a release candidate 1.4.2 and Connector/J 5.1.30 has full support. MySQL Fabric is a new way to implement high-availability and scale-out with MySQL server. It provides a way to group sets of servers into high-availability groups with automatic replication configuration. If scale-out is important, sharding can be defined in terms of these high-availability groups.

To use Connector/J with Fabric, you only need to add the jar to your classpath. If you are still using Java 5, you will need to manually load the com.mysql.fabric.jdbc.FabricMySQLDriver class to register the driver. Fabric-aware connections are made with a JDBC URL of the form jdbc:mysql:fabric://host:port/db. Several connection properties are available to influence the behavior of

  [Read more...]
Live reconfiguration of replication topography in Connector/Java
Employee +2 Vote Up -1Vote Down

As noted in a previous post, MySQL Connector/Java supports multi-master replication topographies as of version 5.1.27, allowing you to scale read load to slaves while directing write traffic to multi-master (or replication ring) servers.  The new release of version 5.1.28 builds upon this, allowing live management of replication host (single or multi-master) topographies.  This parallels functionality that has long existed for load-balanced connections, and enables users to add or remove hosts – or now

  [Read more...]
Multi-master support in MySQL Connector/Java
Employee +1 Vote Up -0Vote Down

MySQL Connector/Java has long had support for replication-aware deployment, allowing a single logical Connection object to effectively “pool” connections to both a master and (potentially multiple) slaves.  This allowed scale-out of read load by distribution of read traffic to slaves, while routing write load to the master.  The JDBC specification provides a nice hook to know what’s read-only traffic – Connection.setReadOnly().  When a boolean value of true is passed, a ReplicationConnection will route further commands a selected slave instance, while values of false trigger routing to the master. 

  [Read more...]
MySQL Connector/J with Fabric Support
Employee +0 Vote Up -0Vote Down
As Tomas announced in his keynote at MySQL Connect 2013, we are working on a brand new product called MySQL Fabric. Along with this release of MySQL Fabric, we are releasing Connector/J 5.1.26 with Fabric support on labs.mysql.com. This is an alpha-quality release that adds support for scalability features in MySQL Fabric. Sharding and read/write splitting are the initial features supported by Connector/J.
In a setup involving read/write splitting or customized sharding, we generally have to duplicate knowledge of this configuration in the client applications. This is done in connection strings specified in configuration files or directly in code. With MySQL Fabric, we can express our system-wide configuration of database servers in a way that it can be accessed by client applications. In cases where this needs to change (and it always does..), the
  [Read more...]
Speaking at MySQL Connect
Employee +2 Vote Up -0Vote Down

The MySQL Connect content catalog is published, and I’ll be leading a hands-on lab on MySQL Enterprise Features in Practice [HOL9787].  If you have wondered how to get the most out of the features of MySQL Enterprise subscriptions (http://www.mysql.com/products/enterprise/" target="_blank) – whether you are an existing Enterprise customer or not – this lab is

  [Read more...]
Practical P_S: Fixing gaps in GLOBAL STATUS
Employee +1 Vote Up -0Vote Down

Over three years ago, I noticed that there was no STATUS counter for COM_PING commands – something that is useful for ensuring proper configuration of JDBC connection pools.  Mark Leith even provided a patch, but it’s never been incorporated.  With the advances PERFORMANCE_SCHEMA makes in MySQL 5.6, that’s OK – a STATUS counter becomes somewhat redundant:

mysql> SELECT SUM(count_star) as pings
    -> FROM events_statements_summary_global_by_event_name
    -> WHERE event_name = 'statement/com/Ping';
+-------+
| pings |
+-------+
|    12 |
+-------+
1 row in set (0.02 sec)


Not only does PERFORMANCE_SCHEMA provide capabilities which mirror the STATUS

  [Read more...]
Finding the source of problematic queries
Employee +3 Vote Up -0Vote Down

Many MySQL users are familiar with using slow query logs and tools such as mysqldumpslow to identify poor-performing SQL commands, and MySQL 5.6 introduces new powerful tools in PERFORMANCE_SCHEMA.  Both allow you to identify the date/time and the user account from which the command was issued, which is helpful – but if you’re using MySQL Enterprise Monitor (MEM), you can immediately identify the actual line of code responsible for the SQL command in question.  This happens to be one of my favorite and powerful features of MEM, but it’s frequently overlooked by new and experienced MEM users alike, so I’m writing the post to highlight it.

MySQL Enterprise Monitor, of course, is a commercial product that’s part of the MySQL Enterprise subscription.  But it’s freely-available under 30-day trial terms for evaluation from

  [Read more...]
Connector/J 5.1.25 Released
Employee +0 Vote Up -0Vote Down

MySQL Connector/J 5.1.25 has been released, and is available in Community and Enterprise flavors on dev.mysql.com and My Oracle Support, respectively.  I’ve already noted the addition of support for connection attributes for MySQL 5.6 – 5.1.25 adds this functionality.  This release also includes a fix for Bug#68733, which caused the special light-weight ping operation to execute only against the master and currently-selected slave, rather than the master plus all active

  [Read more...]
SkySQL/MariaDB Connectors: Some answers and extra info
+3 Vote Up -4Vote Down

On 29 November last year, SkySQL and Monty Program jointly  announced the release of the so called "MariaDB Client Library for C Applications" and "Maria DB Client Library for Java Applications", which I will call C and JDBC connectors here. You can follow this link to read the press release from SkySQL.

Last week Baron Schwartz posted some findings re the C connector in his blog. Today, another post from Robert Hodges added few details and were looking for answers. I think I


  [Read more...]
More GlassFish loadbalancing tips for Connector/J
Employee +1 Vote Up -0Vote Down

Almost two weeks ago, I encouraged GlassFish users who need load-balanced JDBC connections to MySQL Cluster (or master-master replicated MySQL Server) to set the loadBalanceValidateConnectionOnSwapServer property to true in order to help ensure the connection chosen at re-balance is still usable.  That advice triggered finding a bug (14563127) which will cause the following Exception message:

No operations allowed after connection closed. Connection closed after inability to pick valid new connection during fail-over.

If you implemented the loadBalanceValidateConnectionOnSwapServer property and are seeing the above error message, updating your driver to the

  [Read more...]
Load-balanced JDBC Tip for GlassFish Deployments
Employee +3 Vote Up -0Vote Down

Having supported a number of successful load-balanced JDBC applications using MySQL Cluster and MySQL Connector/J over the years, I’ve found a few problems that are unique to specific Java app servers.  A recent customer inquiry reminded me of a GlassFish-specific issue, and the Connector/J connection property we introduced to help solve it.  I thought it might be useful to document this here for any GlassFish users looking to deploy a load-balanced JDBC application with MySQL (Cluster or multi-master replication).

If you’re entirely new to the load-balancing functionality in MySQL Connector/J, you may want to review some earlier

  [Read more...]
Connector/J now supports authentication plugins
Employee +0 Vote Up -0Vote Down

Many people are aware that MySQL 5.5 added support for external authentication plugins, and that Oracle provides several commercial-licensed plugins (http://mysql.com/products/enterprise/security.html" target="_blank) that can help users leverage this functionality out-of-the-box (you can try these and other features (http://mysql.com/trials/" target="_blank)of MySQL commercial offerings for free).  Until the recent release of Connector/J 5.1.19, though, JDBC users could not leverage the plugin capabilities of MySQL 5.5.  Now, Java users can write their own client-side plugins in support of the standard MySQL 5.5 external authentication plugins, or even server-side

  [Read more...]
Connector/J extension points – Load Balancing Strategies
Employee +2 Vote Up -0Vote Down

A fourth and final Connector/J extension point I covered in my JavaOne and Silicon Valley Code Camp presentations is load-balancing strategies.  This exists in order to allow you to define behavior for balancing load across multiple back-end MySQL server instances.  MySQL Connector/J’s load-balancing implementation is a simple internal connection pool.  What appears to your application as a single Connection object can actually have multiple physical connections to MySQL servers underneath (one per configured host/port pair).  At specific points, Connector/J will re-balance and choose another host to

  [Read more...]
Connector/J extension points – exception interceptors
Employee +0 Vote Up -0Vote Down

A third built-in extension point for MySQL Connector/J is the ExceptionInterceptor interface.  This is the third extension point covered in my recent JavaOne and Silicon Valley Code Camp presentations, and is very useful for diagnosing specific Exceptions encountered without modifying application-side code. This corresponds to slide #60 in my slide deck, and there are two Java files we’ll reference from my demo code:

      [Read more...]
    Debugging Communication Link Failure exceptions in Connector/J
    Employee +1 Vote Up -0Vote Down

    Have you seen error messages similar to the following:

    Communications link failure – Last packet sent to the server was X ms ago.

    Judging from the forums, many people have had problems with this.  Here’s a brief overview of the causes, and potential solutions.

    Generally speaking, this error suggests that the network connection has been closed. There can be several root causes:

    • Firewalls or routers may clamp down on
      [Read more...]
    Connector/J ping (there will be a test on this)
    Employee +2 Vote Up -0Vote Down

    MySQL Connector/J has a useful feature which executes a lightweight ping against a server (or, in the case of load-balanced connections, all active pooled internal connections that are retained) to validate the connection. As you might guess, this feature is useful for Java apps which use connection pools, so that the pool can validate the connection. Depending on your connection pool and configuration, this can be done at different times:

    • before the pool returns a connection to the application
    • when the application returns a connection to the pool
    • during periodic checks of idle connections

    So, if you want to use this magic light-weight ping process, here’s how you do it:

    Specifying a “validation query” in your connection pool that starts with “/* ping */” _exactly_ will cause the

      [Read more...]
    Managing load-balanced Connector/J deployments
    Employee +6 Vote Up -0Vote Down

    Connector/J has long provided an effective means to distribute read/write load across multiple MySQL server instances for Cluster or master-master replication deployments, but until version 5.1.13, managing such deployments frequently required a service outage to redeploy a new configuration.  Given that ease of scaling out by adding additional MySQL Cluster (server) instances is a key element in that product offering, which is also naturally targeted at deployments with very strict availability requirements, we had to add support for online changes of this nature.  It’s also critical for online upgrades – the other option is to take a MySQL Cluster server instance down hard, which loses any in-process transactions and generates application exceptions, if any application is trying to use that particular server instance.

    Mark Matthews

      [Read more...]
    Connector/J load-balancing for auto-commit-enabled deployments
    Employee +4 Vote Up -0Vote Down

    In a previous blog post, I wrote about Connector/J’s failover policies, I described three triggers which cause Connector/J to re-balance (potentially selecting a new physical connection to another host):

  • At transaction boundaries (transactions are explicitly committed or rolled back)
  • A communication exception (SQL State starting with “08″) is encountered
  • When a SQLException matches conditions defined by user, using the extension points defined by the loadBalanceSQLStateFailover, loadBalanceSQLExceptionSubclassFailover or loadBalanceExceptionChecker properties.
  • Those conditions fit most needs very well, but there are situations where people are running with

      [Read more...]
    Load-balancing for MySQL Cluster
    Employee +4 Vote Up -0Vote Down

    Shortly after I wrote my last post regarding some advanced Connector/J load-balancing properties, Anirudh published a post describing configuration of RHEL LVS for load-balancing and failover of MySQL Cluster SQL nodes.  It’s an interesting post, and I admit I know very little about RHEL LVS, but it reminded me of problems I experienced when trying to set up load-balanced ColdFusion(!) servers at my last job, years back.  We ended up with a nice hardware load-balancer sitting in front of multiple ColdFusion web servers.  The problems we found were that our application depended upon session state, which was stored (of course) on a single web server.  The load-balancer allowed us to define sticky sessions, which is what we did, but it cost us.

    We

      [Read more...]
    Connector/J’s load-balancing failover policies
    Employee +2 Vote Up -0Vote Down

    Connector/J provides a useful load-balancing implementation for Cluster or multi-master deployments.  As of Connector/J 5.1.12, this same implementation is used under the hood for balancing load between read-only slaves with ReplicationDriver.  When trying to balance workload between multiple servers, though, the driver has to decide when it’s safe to swap servers – doing so in the middle of a transaction would not make applications very happy.  Many of the same principles which apply to autoReconnect also apply here – you don’t want to lose important state information.

    As a result, Connector/J will only try to pick a new server when one of the following happen:

  • At transaction
  •   [Read more...]
    Trace SQL From the Database to the Source Code with MySQL Enterprise Monitor
    Employee +3 Vote Up -0Vote Down

    OK, you found the problem SQL statement that was affecting your server’s performance, now where did it originate?

    The new MySQL Enterprise Plugins for Connector/J and Connector/NET send query statistics, including the source location for each query, directly to the MySQL Enterprise Monitor.

    Figure 1 is a screenshot of new source location feature.

    Figure 1. Source Location

    Figure 2 shows the standard query statistics, which are collected in the query analyzer.  In both cases, the statistics are gathered by the MySQL Connector and the Plugin, not MySQL proxy.

      [Read more...]
    OpenSQLCamp Lightning Talk Videos
    +3 Vote Up -0Vote Down

    OpenSQLCamp was a huge success! Not many folks have blogged about what they learned there….if you missed it, all is not lost. We did take videos of most of the sessions (we only had 3 video cameras, and 4 rooms, and 2 sessions were not recorded).

    All the videos have been processed, and I am working on uploading them to YouTube and filling in details for the video descriptions. Not all the videos are up right now….right now all the lightning talks are up.


      [Read more...]
    Accessing MySQL Database(s) with JDBC
    Employee +0 Vote Up -0Vote Down

    A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

            http://java.sun.com/developer/technicalArticles/mysql_java/index.html

    This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

    Stay tuned for the next article in this series "Using MySQL with PHP" ..

    Accessing MySQL Database(s) with JDBC
    Employee +0 Vote Up -0Vote Down

    A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

            http://java.sun.com/developer/technicalArticles/mysql_java/index.html

    This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

    Stay tuned for the next article in this series "Using MySQL with PHP" ..

    Accessing MySQL Database(s) with JDBC
    Employee +0 Vote Up -0Vote Down

    A new technical article entitled "Using the MySQL Connector/J JDBC Driver With the Java SE Platform", has been posted on java.sun.com at:

            http://java.sun.com/developer/technicalArticles/mysql_java/index.html

    This article explains the essential steps involved in accessing/manipulating the data in a MySQL database from a Java application. MySQL Connector/J JDBC driver was used in the example code to show the database connectivity, data manipulation steps. Application developers who are new to Java programming language [but not to MySQL database] are the target audience of this article.

    Stay tuned for the next article in this series "Using MySQL with PHP" ..

    Showing entries 1 to 25

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.