Re: Curious case of DataSource.getConnection()

2016-04-12 Thread Shalin Shekhar Mangar
What is this Solr scheduler class? Is that your own custom code? None of
the information or code snippets in your email related to a Solr problem. I
guess you are looking to troubleshoot a DB connectivity problem and it
would be better to ask this on stackoverflow.

On Tue, Apr 12, 2016 at 4:01 PM, Srinivas Kashyap <
srini...@tradestonesoftware.com> wrote:

> Hi,
>
> In a Solr scheduler class which runs every 'n' interval of seconds, i'm
> polling a database table to do some custom job.
>
> I'm getting the connection to database, through context file as below:
>
> try {
>  Context initContext = new InitialContext();
>  DataSource ds = null;
>  if ("tomcat".equals(p.getProperty("server.type")))
>  {
>Context webContext =
> (Context)initContext.lookup("java:/comp/env");
>ds = (DataSource)
> webContext.lookup("");
>  }
>  else if ("ws".equals(p.getProperty("server.type")))
> //websphere
>  {
>ds = (DataSource)
> initContext.lookup("");
>  }
> }
>
>  ds.getConnection();
>
>
> But the, connection is not being established. No Exception/error is being
> thrown in console.
>
> Context xml has been double checked to see all the datasource properties
> and attributes are set proper.
>
> Any reason, i'm not able to establish database connection?
>
> P.S: Normal IMPORT process is running unaffected i.e Data is being indexed
> into solr with the same datasource configuration in context xml.
>
>
> Thanks and Regards,
> Srinivas Kashyap
> Senior Software Engineer
> "GURUDAS HERITAGE"
> 'Block A' , No 59/2, 2nd Floor, 100 Feet Ring Road,
> Kadirenahalli, Padmanabhanagar
> Banashankari 2nd Stage,
> Bangalore-560070
> P:  973-986-6105
> Bamboo Rose
> The only B2B marketplace powered by proven trade engines.
> www.BambooRose.com
>
> Make Retail. Fun. Connected. Easier. Smarter. Together. Better.
>
>
> DISCLAIMER:
> E-mails and attachments from TradeStone Software, Inc. are confidential.
> If you are not the intended recipient, please notify the sender
> immediately by
> replying to the e-mail, and then delete it without making copies or using
> it
> in any way. No representation is made that this email or any attachments
> are
> free of viruses. Virus scanning is recommended and is the responsibility of
> the recipient.




-- 
Regards,
Shalin Shekhar Mangar.


Curious case of DataSource.getConnection()

2016-04-12 Thread Srinivas Kashyap
Hi,

In a Solr scheduler class which runs every 'n' interval of seconds, i'm polling 
a database table to do some custom job.

I'm getting the connection to database, through context file as below:

try {
 Context initContext = new InitialContext();
 DataSource ds = null;
 if ("tomcat".equals(p.getProperty("server.type")))
 {
   Context webContext = 
(Context)initContext.lookup("java:/comp/env");
   ds = (DataSource) 
webContext.lookup("");
 }
 else if ("ws".equals(p.getProperty("server.type"))) 
//websphere
 {
   ds = (DataSource) 
initContext.lookup("");
 }
}

 ds.getConnection();


But the, connection is not being established. No Exception/error is being 
thrown in console.

Context xml has been double checked to see all the datasource properties and 
attributes are set proper.

Any reason, i'm not able to establish database connection?

P.S: Normal IMPORT process is running unaffected i.e Data is being indexed into 
solr with the same datasource configuration in context xml.


Thanks and Regards,
Srinivas Kashyap
Senior Software Engineer
"GURUDAS HERITAGE"
'Block A' , No 59/2, 2nd Floor, 100 Feet Ring Road,
Kadirenahalli, Padmanabhanagar
Banashankari 2nd Stage,
Bangalore-560070
P:  973-986-6105
Bamboo Rose
The only B2B marketplace powered by proven trade engines.
www.BambooRose.com

Make Retail. Fun. Connected. Easier. Smarter. Together. Better.


DISCLAIMER: 
E-mails and attachments from TradeStone Software, Inc. are confidential.
If you are not the intended recipient, please notify the sender immediately by
replying to the e-mail, and then delete it without making copies or using it
in any way. No representation is made that this email or any attachments are
free of viruses. Virus scanning is recommended and is the responsibility of
the recipient.