<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Map Reduce error for concurrent user from Java application to access Apache Hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301672#M220796</link>
    <description>&lt;P&gt;Hello Asish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;It's working now with concurrent users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;KK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Aug 2020 05:53:03 GMT</pubDate>
    <dc:creator>K_K</dc:creator>
    <dc:date>2020-08-20T05:53:03Z</dc:date>
    <item>
      <title>Map Reduce error for concurrent user from Java application to access Apache Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301213#M220558</link>
      <description>&lt;P class="Standard"&gt;We have a user interface based on Java. This application connects Hive as data source. Please find the product version of Apache Hive below. Application is working fine when single user has login with the application to access data from Hive. It gives error while concurrent users login to same application and access the Hive data..&lt;/P&gt;&lt;P class="Standard"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="Standard"&gt;apache-hive-2.3.7&lt;/P&gt;&lt;P class="Standard"&gt;db-derby-10.14.2.0&lt;/P&gt;&lt;P class="Standard"&gt;hadoop-2.10.0&lt;/P&gt;&lt;P class="Standard"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="Standard"&gt;Further investigation –&lt;/P&gt;&lt;P class="Standard"&gt;The authentication mechanism of Hive is NOSASL. We did a small mutli threaded java application for debugging. Please find Java code and log for your analysis.&lt;/P&gt;&lt;P class="Standard"&gt;Thanks in advance for your help!!&lt;/P&gt;&lt;P class="Standard"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import java.sql.Connection;&lt;BR /&gt;import java.sql.DriverManager;&lt;BR /&gt;import java.sql.PreparedStatement;&lt;BR /&gt;import java.sql.ResultSet;&lt;BR /&gt;import java.sql.SQLException;&lt;/P&gt;&lt;P&gt;public class MapReduceThreadClass implements Runnable {&lt;BR /&gt;String name;&lt;BR /&gt;Thread t;&lt;BR /&gt;String query;&lt;BR /&gt;MapReduceThreadClass (String thread,String query){&lt;BR /&gt;name = thread;&lt;BR /&gt;this.query=query;&lt;BR /&gt;t = new Thread(this, name);&lt;BR /&gt;System.out.println("New thread: " + t);&lt;BR /&gt;t.start();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt;public void run() {&lt;BR /&gt;Connection conn = null;&lt;BR /&gt;try {&lt;BR /&gt;Class.forName("org.apache.hive.jdbc.HiveDriver");&lt;BR /&gt;String url = "jdbc:hive2://XX.XX.XX.XX:10000/test1;auth=noSasl";&lt;BR /&gt;conn = DriverManager.getConnection(url);&lt;/P&gt;&lt;P&gt;PreparedStatement ps=conn.prepareStatement(query);&lt;BR /&gt;System.out.println("thread "+Thread.currentThread().getName()+"before query execution");&lt;BR /&gt;ResultSet rs=ps.executeQuery();&lt;BR /&gt;if(rs.next()) {&lt;BR /&gt;System.out.println("thread "+Thread.currentThread().getName()+"::"+rs.getString(1));&lt;BR /&gt;System.out.println("thread "+Thread.currentThread().getName()+"::"+"Got it!");&lt;BR /&gt;}&lt;BR /&gt;} catch (Exception e) {&lt;BR /&gt;e.printStackTrace();&lt;BR /&gt;throw new Error("Problem", e);&lt;BR /&gt;} finally {&lt;BR /&gt;try {&lt;BR /&gt;if (conn != null) {&lt;BR /&gt;conn.close();&lt;BR /&gt;}&lt;BR /&gt;} catch (SQLException ex) {&lt;BR /&gt;System.out.println(ex.getMessage());&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;// TODO Auto-generated method stub&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;public class MapReduceMain {&lt;/P&gt;&lt;P&gt;public static void main(String[] args) {&lt;BR /&gt;//18&lt;BR /&gt;for(int i=0;i&amp;lt;Integer.parseInt(args[0]);i++)&lt;BR /&gt;{&lt;BR /&gt;new MapReduceThreadClass(i+1+"",args[1]);&lt;BR /&gt;}&lt;BR /&gt;// TODO Auto-generated method stub&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 16:26:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301213#M220558</guid>
      <dc:creator>K_K</dc:creator>
      <dc:date>2020-08-10T16:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Map Reduce error for concurrent user from Java application to access Apache Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301280#M220588</link>
      <description>&lt;P&gt;Derby only allows single connection (process) to access the database at a give time, hence only one user can access the Hive.&lt;/P&gt;&lt;P&gt;Upgrade your hive metastore to either MySQL, PostgreSQL to support multiple concurrent connections to Hive.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 17:11:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301280#M220588</guid>
      <dc:creator>asish</dc:creator>
      <dc:date>2020-08-11T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Map Reduce error for concurrent user from Java application to access Apache Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301672#M220796</link>
      <description>&lt;P&gt;Hello Asish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;It's working now with concurrent users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;KK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 05:53:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Map-Reduce-error-for-concurrent-user-from-Java-application/m-p/301672#M220796</guid>
      <dc:creator>K_K</dc:creator>
      <dc:date>2020-08-20T05:53:03Z</dc:date>
    </item>
  </channel>
</rss>

