Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6887 dpurdie 1
########################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
3
#
4
# Module name   : jats_rm_play24.pl
5
# Module type   : Makefile system
6
# Compiler(s)   : n/a
7
# Environment(s): jats
8
#
9
# Description   : Exeriment with invoking direct insertion into Release Manager
10
#
11
#
12
#......................................................................#
13
 
14
require 5.006_001;
15
use strict;
16
use warnings;
17
use JatsError;
18
use JatsSystem;
19
use Getopt::Long;
20
use Pod::Usage;                             # required for help support
21
use JatsRmApi;
22
 
23
use DBI;
24
 
25
my $VERSION = "1.2.3";                      # Update this
26
my $opt_verbose = 1;
27
my $opt_help = 0;
28
my $opt_manual;
29
my $RM_DB;
30
 
31
#-------------------------------------------------------------------------------
32
# Function        : Main Entry
33
#
34
# Description     :
35
#
36
# Inputs          :
37
#
38
# Returns         :
39
#
40
my $result = GetOptions (
41
                "help+"         => \$opt_help,          # flag, multiple use allowed
42
                "manual"        => \$opt_manual,        # flag
43
                "verbose+"      => \$opt_verbose,       # flag
44
                );
45
 
46
#
47
#   Process help and manual options
48
#
49
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
50
pod2usage(-verbose => 1)  if ($opt_help == 2 );
51
pod2usage(-verbose => 2)  if ($opt_manual || ($opt_help > 2));
52
 
53
 
54
ErrorConfig( 'name'    =>'PLAY27' );
55
 
56
$ENV{GBE_RM_LOCATION} = 'jdbc:oracle:thin:@auperaora07:1521:RELMANU1';
57
$ENV{GBE_RM_USERNAME} = 'release_manager'; 
58
$ENV{GBE_RM_PASSWORD} =  'release_manager';
59
 
60
for (my $ii = 0; $ii < 50000; $ii++)
61
{
62
    directInject($ii);
63
}
64
exit;
65
 
66
sub directInject
67
{
68
    my ($index) = @_;
69
    my $foundDetails = 0;
70
    my (@row);
71
 
72
    # if we are not or cannot connect then return 0 as we have not found anything
73
    connectRM(\$RM_DB) unless $RM_DB;
74
 
75
    #
76
    #   Create the SQL to process
77
    #
78
 
79
    my $m_sqlstr =  "INSERT INTO release_manager.release_components ( pv_id, file_name, file_path, byte_size, crc_cksum, crc_modcrc ) " .
80
                    " VALUES ( 1, 'fred', 'david".$index."/fred', 199, '12345', '67890')";
81
 
82
print("$m_sqlstr\n");
83
    my $sth = $RM_DB->prepare($m_sqlstr);
84
    if ( defined($sth) )
85
    {
86
        if ( $sth->execute( ) )
87
        {
88
#           print "--- Execute\n";
89
#           if ( $sth->rows )
90
#           {
91
#               print "--- Execute ROWS\n";
92
#               while ( @row = $sth->fetchrow_array )
93
#               {
94
#                   print "Data: @row\n";
95
#               }
96
#           }
97
#           print "--- Finish\n";
98
            $sth->finish();
99
        }
100
        else
101
        {
102
            Error("Execute failure: $m_sqlstr", $sth->errstr() );
103
        }
104
    }
105
    else
106
    {
107
        Error("Prepare failure" );
108
    }
109
}
110
 
111