Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 323C4D3EE for ; Wed, 13 Feb 2013 20:02:04 +0000 (UTC) Received: (qmail 73115 invoked by uid 500); 13 Feb 2013 20:02:03 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 73095 invoked by uid 500); 13 Feb 2013 20:02:03 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 73086 invoked by uid 99); 13 Feb 2013 20:02:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2013 20:02:03 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jamalraihan@gmail.com designates 209.85.219.49 as permitted sender) Received: from [209.85.219.49] (HELO mail-oa0-f49.google.com) (209.85.219.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2013 20:01:55 +0000 Received: by mail-oa0-f49.google.com with SMTP id j6so1694811oag.22 for ; Wed, 13 Feb 2013 12:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=+rKLTyfkqSTEiiD6UGJ6ybmbpHu6rqPiwLdG4F6qXhA=; b=gcsj7jCWQro2UTG8VCfr3iNYKb+hfNvOrZ5g5z4NegW+RrVjF7WS3W3qNuyTASFa9k RkiTbunxAcoKtHvmEy87Hc8+7TBcX1OTrnKqE9RMQckvNZSEPNmXWRlqoBwcKZMyfldl WA5bx1dvdt0rRcgMlf9j+z2b9LsRtbLZrcdf6LvMHEC9ejsFcJTj0NsRmKt7zIAGYU9f YSO8L+Qvxvs1M6riEwAfN1ahTlR9FSW03grHmR+M9lixBwct2GasU+DCXt569ztgPh8l HM12agKDq9BQEjsyBcrOg0lT/PDkFcCk05/ZGTxJEj07ofW8AQzDnnZaTcltogI3VR/L HGJQ== X-Received: by 10.60.24.201 with SMTP id w9mr17743764oef.73.1360785694131; Wed, 13 Feb 2013 12:01:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.133.134 with HTTP; Wed, 13 Feb 2013 12:01:14 -0800 (PST) In-Reply-To: References: From: Raihan Jamal Date: Wed, 13 Feb 2013 12:01:14 -0800 Message-ID: Subject: Re: Generate Random Unique numbers using JMeter To: user@jmeter.apache.org Content-Type: multipart/alternative; boundary=e89a8fb2007aea05d904d5a09ba5 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb2007aea05d904d5a09ba5 Content-Type: text/plain; charset=ISO-8859-1 I made some progress on this. I have initialize counter variable like this- init variable (eg in "User Defined Variables"): Name: | Value ------------+--------- LoopCounter | 0 And in my Parameter values I am using something like this now- *${__intSum(${LoopCounter},1,LoopCounter)} ,"{""lv"":[{""v"":{""regId"":null,"" user"":null,""Id"":996},""cn"":1}],""lmd"":1360185}"* * * And my *LoopCounter* is something like this- Name:- LoopCounter Start:- 1 Increment:- 1 Maximum:- 1000 Number format:- 000 I have unchecked *Track counter independently for each user* * * But still I am getting exception thrown as Primary Key violation. Is there anything wrong I am doing here? *Raihan Jamal* On Wed, Feb 13, 2013 at 11:41 AM, Raihan Jamal wrote: > I am trying to insert into the below table currently using JMeter- > > INSERT INTO XMP_TEST2 (id, a_sellers) values (?, ?) > > Data Types for the above columns are- > > *id String* > *a_sellers String* > > In the above table *id is the Primary Key. *So I need some way to > generate unique id always either starting from 1 or any random unique > numbers. Is there any way I can do that in JMeter? > > Currently in my Parameter Values, I am passing something like this to > insert in the above two columns- > > > ${__BeanShell(UUID.randomUUID().toString())} > ,"{""lv"":[{""v"":{""regId"":null,"" > user"":null,""Id"":996},""cn"":1}],""lmd"":1360185}" > > > And Parameter types is- > > VARCHAR,VARCHAR > > > One approach I am thinking of is keep on increment by one every time. But > how should I do in this JMeter? > > Does anyone has any experience on this particular problem? > > > Looking forward for your replies. > > > > > *Raihan Jamal* > --e89a8fb2007aea05d904d5a09ba5--