|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
Worker Process hanging at DriverManager.getConnectionhi,
I have my Worker process hanging whenever I try to connect to Excel using Jdbc-Odbc Driver at DriverManager.getConnection. However the same is executing fine when i ran the Grinder in Debugging mode by setting property grinder.debug.singleprocess to 'true'. Here is code which follow the "Grinding the Database with JDBC" example on Grinder.Sorceforge.net Site[http://grinder.sourceforge.net/g3/script-gallery.html#jdbc] ***********MyCode*********** # Some simple database playing with Excel. import java from java.sql import DriverManager from net.grinder.script.Grinder import grinder from net.grinder.script import Test #from oracle.jdbc import OracleDriver #test1 = Test(1, "Database insert") #test2 = Test(2, "Database query") # Load the Oracle JDBC driver. #DriverManager.registerDriver(OracleDriver()) print "registering Driver" java.lang.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") def getConn(): print "getting Connection" return DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};ReadOnly=True;DBQ=C:\\TIX.xls") def ensureClosed(object): try: object.close() except: pass # One time initialisation that cleans out old data. connection = getConn() statement = connection.createStatement() #try: statement.execute("drop table grinder_fun") try: connection.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_UPDATABLE) query = "select * from [Login$];" rsLogin = statement.executeQuery(query) while rsLogin.next(): print rsLogin.getString("LoginID") except: pass #statement.execute("create table grinder_fun(thread number, run number)") ensureClosed(statement) ensureClosed(connection) class TestRunner: def __call__(self): connection = None statement = None try: print "Inside Thread" except: pass **************************** |
|
|
Re: Worker Process hanging at DriverManager.getConnectionThe Grinder worker process does when loading some shared libraries under
Windows. Unfortunately, the problem is due to Java/Windows/the shared library, and is not a problem with The Grinder itself. Running with grinder.debug.singleprocess to 'true' is probably your best workaround. I'm not sure it makes much sense to grind an Excel spreadsheet though. :-) - Phil xat8mum wrote: > hi, > I have my Worker process hanging whenever I try to connect to Excel using > Jdbc-Odbc Driver at DriverManager.getConnection. > However the same is executing fine when i ran the Grinder in Debugging mode > by setting property > grinder.debug.singleprocess to 'true'. > Here is code which follow the "Grinding the Database with JDBC" example on > Grinder.Sorceforge.net > Site[http://grinder.sourceforge.net/g3/script-gallery.html#jdbc] > ***********MyCode*********** > # Some simple database playing with Excel. > > import java > from java.sql import DriverManager > from net.grinder.script.Grinder import grinder > from net.grinder.script import Test > #from oracle.jdbc import OracleDriver > > #test1 = Test(1, "Database insert") > #test2 = Test(2, "Database query") > > # Load the Oracle JDBC driver. > #DriverManager.registerDriver(OracleDriver()) > print "registering Driver" > java.lang.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") > > > def getConn(): > print "getting Connection" > return DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel > Driver (*.xls)};ReadOnly=True;DBQ=C:\\TIX.xls") > > def ensureClosed(object): > try: object.close() > except: pass > > # One time initialisation that cleans out old data. > connection = getConn() > statement = connection.createStatement() > > #try: statement.execute("drop table grinder_fun") > try: > > connection.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_UPDATABLE) > query = "select * from [Login$];" > rsLogin = statement.executeQuery(query) > while rsLogin.next(): > print rsLogin.getString("LoginID") > > except: pass > > #statement.execute("create table grinder_fun(thread number, run number)") > > ensureClosed(statement) > ensureClosed(connection) > > class TestRunner: > def __call__(self): > connection = None > statement = None > > try: > print "Inside Thread" > except: pass > > > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ grinder-use mailing list grinder-use@... https://lists.sourceforge.net/lists/listinfo/grinder-use |
|
|
Re: Worker Process hanging at DriverManager.getConnection
|
|
|
Re: Worker Process hanging at DriverManager.getConnectionxat8mum - did you mean to reply to my message?
- Phil xat8mum wrote: > > Philip Aston-3 wrote: > >> The Grinder worker process does when loading some shared libraries under >> Windows. >> >> Unfortunately, the problem is due to Java/Windows/the shared library, >> and is not a problem with The Grinder itself. >> >> Running with grinder.debug.singleprocess to 'true' is probably your best >> workaround. I'm not sure it makes much sense to grind an Excel >> spreadsheet though. :-) >> >> - Phil >> >> xat8mum wrote: >> >>> hi, >>> I have my Worker process hanging whenever I try to connect to Excel using >>> Jdbc-Odbc Driver at DriverManager.getConnection. >>> However the same is executing fine when i ran the Grinder in Debugging >>> mode >>> by setting property >>> grinder.debug.singleprocess to 'true'. >>> Here is code which follow the "Grinding the Database with JDBC" example >>> on >>> Grinder.Sorceforge.net >>> Site[http://grinder.sourceforge.net/g3/script-gallery.html#jdbc] >>> ***********MyCode*********** >>> # Some simple database playing with Excel. >>> >>> import java >>> from java.sql import DriverManager >>> from net.grinder.script.Grinder import grinder >>> from net.grinder.script import Test >>> #from oracle.jdbc import OracleDriver >>> >>> #test1 = Test(1, "Database insert") >>> #test2 = Test(2, "Database query") >>> >>> # Load the Oracle JDBC driver. >>> #DriverManager.registerDriver(OracleDriver()) >>> print "registering Driver" >>> java.lang.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") >>> >>> >>> def getConn(): >>> print "getting Connection" >>> return DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel >>> Driver (*.xls)};ReadOnly=True;DBQ=C:\\TIX.xls") >>> >>> def ensureClosed(object): >>> try: object.close() >>> except: pass >>> >>> # One time initialisation that cleans out old data. >>> connection = getConn() >>> statement = connection.createStatement() >>> >>> #try: statement.execute("drop table grinder_fun") >>> try: >>> >>> connection.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_UPDATABLE) >>> query = "select * from [Login$];" >>> rsLogin = statement.executeQuery(query) >>> while rsLogin.next(): >>> print rsLogin.getString("LoginID") >>> >>> except: pass >>> >>> #statement.execute("create table grinder_fun(thread number, run number)") >>> >>> ensureClosed(statement) >>> ensureClosed(connection) >>> >>> class TestRunner: >>> def __call__(self): >>> connection = None >>> statement = None >>> >>> try: >>> print "Inside Thread" >>> except: pass >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> grinder-use mailing list >> grinder-use@... >> https://lists.sourceforge.net/lists/listinfo/grinder-use >> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ grinder-use mailing list grinder-use@... https://lists.sourceforge.net/lists/listinfo/grinder-use |
|
|
Re: Worker Process hanging at DriverManager.getConnectionhi,
Something got missing as my last reply goes astray... i am sorry for inconvinience ... ...:-) ya it's not a good idea to Grind the Excel.....the Code Snippet was a Test script ,just to fetch Data from Excel. Actully was intending to parameterized my Script from an external Data Source and i had the option of using either a .py or .xls [like QTP uses] . I was just testing a stand alone script with Excel and got struck. I prefer .xls over .py as External Source , so is there a way out? IF NOT , will I be deprive of any Grinder utility by running with grinder.debug.singleprocess to 'true' ? or shall i drop .xls as my external source?
|
|
|
Re: Worker Process hanging at DriverManager.getConnectionI would drop excel as your parameter source. Or perhaps save your
spreadsheet as a .csv file, and use that. - Phil xat8mum wrote: > hi, > Something got missing as my last reply goes astray... i am sorry for > inconvinience ... > ...:-) ya it's not a good idea to Grind the Excel.....the Code Snippet was > a Test script ,just to fetch Data from Excel. > Actully was intending to parameterized my Script from an external Data > Source and i had the option of using either a .py or .xls [like QTP uses] . > I was just testing a stand alone script with Excel and got struck. > I prefer .xls over .py as External Source , so is there a way out? > IF NOT , will I be deprive of any Grinder utility by running with > grinder.debug.singleprocess to 'true' ? > or shall i drop .xls as my external source? > > Philip Aston-3 wrote: > >> The Grinder worker process does when loading some shared libraries under >> Windows. >> >> Unfortunately, the problem is due to Java/Windows/the shared library, >> and is not a problem with The Grinder itself. >> >> Running with grinder.debug.singleprocess to 'true' is probably your best >> workaround. I'm not sure it makes much sense to grind an Excel >> spreadsheet though. :-) >> >> - Phil >> >> xat8mum wrote: >> >>> hi, >>> I have my Worker process hanging whenever I try to connect to Excel using >>> Jdbc-Odbc Driver at DriverManager.getConnection. >>> However the same is executing fine when i ran the Grinder in Debugging >>> mode >>> by setting property >>> grinder.debug.singleprocess to 'true'. >>> Here is code which follow the "Grinding the Database with JDBC" example >>> on >>> Grinder.Sorceforge.net >>> Site[http://grinder.sourceforge.net/g3/script-gallery.html#jdbc] >>> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ grinder-use mailing list grinder-use@... https://lists.sourceforge.net/lists/listinfo/grinder-use |
|
|
Re: Worker Process hanging at DriverManager.getConnectionyes Phil, we do able to connect to .csv file with multiple threads , not with a microsoft provided driver but with 'csvjdbc' ,an external driver which is available from sourceforge site only .This driver has limitation that it can only query the .csv, no insertion or update is allowed.So again there is a hurdle,would really appreciate your advise at this point.
|
|
|
Re: Worker Process hanging at DriverManager.getConnectionWhy use JDBC at all?
Although Jython doesn't include the standard Python csv module (a strange ommision), you can generate your own csv with a little coding. - Phil xat8mum wrote: > yes Phil, we do able to connect to .csv file with multiple threads , not with > a microsoft provided driver but with 'csvjdbc' ,an external driver which is > available from sourceforge site only .This driver has limitation that it can > only query the .csv, no insertion or update is allowed.So again there is a > hurdle,would really appreciate your advise at this point. > > > Philip Aston-3 wrote: > >> I would drop excel as your parameter source. Or perhaps save your >> spreadsheet as a .csv file, and use that. >> >> - Phil >> >> xat8mum wrote: >> >>> hi, >>> Something got missing as my last reply goes astray... i am sorry for >>> inconvinience ... >>> ...:-) ya it's not a good idea to Grind the Excel.....the Code Snippet >>> was >>> a Test script ,just to fetch Data from Excel. >>> Actully was intending to parameterized my Script from an external Data >>> Source and i had the option of using either a .py or .xls [like QTP uses] >>> . >>> I was just testing a stand alone script with Excel and got struck. >>> I prefer .xls over .py as External Source , so is there a way out? >>> IF NOT , will I be deprive of any Grinder utility by running with >>> grinder.debug.singleprocess to 'true' ? >>> or shall i drop .xls as my external source? >>> >>> Philip Aston-3 wrote: >>> >>> >>>> The Grinder worker process does when loading some shared libraries under >>>> Windows. >>>> >>>> Unfortunately, the problem is due to Java/Windows/the shared library, >>>> and is not a problem with The Grinder itself. >>>> >>>> Running with grinder.debug.singleprocess to 'true' is probably your best >>>> workaround. I'm not sure it makes much sense to grind an Excel >>>> spreadsheet though. :-) >>>> >>>> - Phil >>>> >>>> xat8mum wrote: >>>> >>>> >>>>> hi, >>>>> I have my Worker process hanging whenever I try to connect to Excel >>>>> using >>>>> Jdbc-Odbc Driver at DriverManager.getConnection. >>>>> However the same is executing fine when i ran the Grinder in Debugging >>>>> mode >>>>> by setting property >>>>> grinder.debug.singleprocess to 'true'. >>>>> Here is code which follow the "Grinding the Database with JDBC" example >>>>> on >>>>> Grinder.Sorceforge.net >>>>> Site[http://grinder.sourceforge.net/g3/script-gallery.html#jdbc] >>>>> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ grinder-use mailing list grinder-use@... https://lists.sourceforge.net/lists/listinfo/grinder-use |
| Free embeddable forum powered by Nabble | Forum Help |