Durable subscriber problem in 10G

Hello all,
We are trying to upgrade an application which uses AQ from Oracle 9i to 10G (10.2.0).
While having a topic owned by one user (metr_data) and trying to create a durable subscriber as another one (metr), we're getting an ORA-01031 error. Just dequeueing
messages as this user works fine...
Is there some additional privilege to be granted for creating durable subscribers?
A small test program:
// Create queue as metr_data
Properties p = new Properties();
p.put("user","metr_data");
p.put("password","metr_data");
Connection c1 = DriverManager.getConnection("jdbc:oracle:thin:system/system@//localhost:1521/WTS",p);
TopicConnection topicConnection1 = AQjmsTopicConnectionFactory.createTopicConnection(c1);
topicConnection1.start();
AQjmsSession topicSession1 = (AQjmsSession)topicConnection1.createTopicSession(true,0);
AQQueueTableProperty qtp = new AQQueueTableProperty("SYS.AQ$_JMS_TEXT_MESSAGE");
qtp.setMultiConsumer(true);
AQQueueTable qt = topicSession1.createQueueTable("metr_data", "testtab", qtp);
System.out.println("Created table");
AQjmsDestinationProperty dp = new AQjmsDestinationProperty();
AQjmsDestination t = (AQjmsDestination) topicSession1.createTopic(qt, "test",dp);
System.out.println("Created queue" );
Topic topic1 = topicSession1.createTopic("METR_DATA.test");
System.out.println(topic1);
( (AQjmsDestination)topic1).grantTopicPrivilege(topicSession1, "DEQUEUE","metr", false);
// Access queue as metr
Connection c = DriverManager.getConnection("jdbc:oracle:thin:system/system@//localhost:1521/WTS","metr","metr");
TopicConnection topicConnection = AQjmsTopicConnectionFactory.createTopicConnection(c);
topicConnection.start();
TopicSession topicSession = topicConnection.createTopicSession(true,0);
Topic topic = topicSession.createTopic("metr_data.test");
System.out.println(topic);
TopicSubscriber s = topicSession.createDurableSubscriber(topic,"metr");
System.out.println(s);
I do have granted the metr user execute on the 4 traditional aq packages.....
Regards,
Francois.

Hi All,
I am able to connect again using the same clientid when i stop/start the web application. I am just curious why the command "imqcmd destroy dur" has no effect on such a situation.

Similar Messages

  • JMS Topic - Deliver to only one Durable Subscriber

    Hi,
    Is it possible to put a message onto a topic but only have it delivered to a single durable subscriber?
    I realise this breaks the rules of what a topic is but this is for a scenario where a single subscriber has errored when processing the original message from the topic. I am putting a user interaction process to recover it and if the user selects ‘resubmit’ I want to put the message back on the topic but only deliver it to the one subscriber that failed to process the message.
    My ways to achieve this (in order of preference) would be.
    1.     JMS Adapter
    2.     Writing Java to use JMS API
    If neither of these are possible than:
    3.     Create a System Resubmit queue and have every composite look for message on the resubmit queue (with their client ID) as well as the normal topic they use
    Of course I would like to avoid 3 as it introduces a complication into every process we create that takes messages from a JMS Topic.
    Thanks for your help.
    Robert

    I could suggest a (dirty) trick:
    all subscribers subscribe to the topic using a filter (message selector, http://docs.oracle.com/javaee/6/tutorial/doc/bnceh.html#bncer)
    SUBSCRIBER1 uses:
    destination = ALL OR SUBSCRIBER1
    SUBSCRIBER2 uses:
    destination = ALL OR SUBSCRIBER2
    etc
    The first message has the property destination set to ALL, so all subscribers will process it.
    The resubmitted message will have destination = SUBSCRIBER<N>, where N is the failed subscriber

  • How to configure MDB as Durable Subscriber

              I can't seem to find any documentation on how to set up an MDB as a Durable Subscriber.
              I tried using the Edit EJB Descriptor link in the console. I then drilled down
              to Message Driven Destination. For Subscription Durability, I selected Durable.
              I clicked Apply. I also went back to the jar and pressed the Persist button to
              "Persist changes made to the Descriptor(s)".
              I check the Topic to see if there were any Durable Subscribers listed. No. I bounced
              the server. Still no.
              What am I missing? The only info I can find in the documentation about setting
              up Durable Subscriptions is via the JMS API (http://e-docs.bea.com/wls/docs61/jms/implement.html#1097632)
              Using WL v6 SP5, not clustered.
              Any help would be appreciated.
              Jim
              

    Hi James,
              I'm unfamiliar with the console ejb xml editor. I suggest
              posting to the ejb newsgbroup, which is more familiar
              with these things. Meanwhile, the attached notes
              and the following example may help if your willing
              to hand-edit the xml.
              Tom, BEA
              <ejb-jar>
              <enterprise-beans>
              <message-driven>
              <ejb-name>exampleMessageDrivenA</ejb-name>
              <ejb-class>MessageBean</ejb-class>
              <transaction-type>Container</transaction-type>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              <!--
              <destination-type>javax.jms.Topic</destination-type>
              <subscription-durability>Durable</subscription-durability>
              -->
              </message-driven-destination>
              </message-driven>
              </enterprise-beans>
              <assembly-descriptor>
              <container-transaction>
              <method>
              <ejb-name>exampleMessageDrivenA</ejb-name>
              <method-name>onMessage()</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              </ejb-jar>
              <!-- Sample MessageDriven bean Weblogic deployment descriptor -->
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>exampleMessageDrivenA</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>5</max-beans-in-free-pool>
              <initial-beans-in-free-pool>5</initial-beans-in-free-pool>
              </pool>
              <!--
              <destination-jndi-name>quotestopic</destination-jndi-name>
              -->
              <destination-jndi-name>MDBQ</destination-jndi-name>
              <!--
              <provider-url>t3://localhost:10001</provider-url>
              <connection-factory-jndi-name>cf3</connection-factory-jndi-name>
              <jms-client-id>cid444</jms-client-id>
              -->
              </message-driven-descriptor>
              <jndi-name>someid</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              James Goodwin wrote:
              > I can't seem to find any documentation on how to set up an MDB as a Durable Subscriber.
              > I tried using the Edit EJB Descriptor link in the console. I then drilled down
              > to Message Driven Destination. For Subscription Durability, I selected Durable.
              > I clicked Apply. I also went back to the jar and pressed the Persist button to
              > "Persist changes made to the Descriptor(s)".
              >
              > I check the Topic to see if there were any Durable Subscribers listed. No. I bounced
              > the server. Still no.
              >
              > What am I missing? The only info I can find in the documentation about setting
              > up Durable Subscriptions is via the JMS API (http://e-docs.bea.com/wls/docs61/jms/implement.html#1097632)
              >
              > Using WL v6 SP5, not clustered.
              >
              > Any help would be appreciated.
              >
              > Jim
              A durable topic subscriber MDB uses its name to generate its client-id.
              Since JMS enforces uniqueness on this client-id, this means that if a durable
              subscriber MDB is deployed to multiple servers only one server will be able
              to connect. Some applications want a different behavior where
              each MDB pool on each server gets its own durable subscription.
              The MDB durable subscription id, which must be unique on its topic, comes from:
              1) <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              2) if (1) is not set then the client-id
              comes from the ejb name.
              The durable subscription is uniquely identified within a cluster by a
              combination of "connection-id" and "subscription-id". Only one active
              connection may use a particular "connection-id" within a WebLogic cluster.
              The connection id comes from:
              1) The "ClientId" attribute configured on the WebLogic connection factory.
              This defaults to null. Note that if the ClientId is set on a connection
              factory, only one connection created by the factory
              may be active at a time.
              2) If (1) is not set, then, as with the subscriber-id,
              the connection-id is derived from jms-client-id descriptor attribute:
              <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              3) If (1) and (2) are not set, then, as with the subscriber-id,
              the connection-id is derived from the ejb name.
              Work-around:
              A) Create a custom connection-factory for each server:
              1) configure "JNDIName" to the same value across all servers
              ("myMDBCF" in this example)
              2) configure "ClientId" to a unique value per server
              3) enable "UserTransactionsEnabled"
              4) enable "XAConnectionFactoryEnabled"
              5) set "AcknowledgePolicy" to "ACKNOWLEDGE_PREVIOUS"
              6) target the CF at a single WebLogic server
              (Number 5 is required for non-transactional topic MDBs)
              B) In the MDB's weblogic-ejb-jar.xml descriptor, set the MDB's connection
              factory to the JNDI name of the custom connection factories configured in
              (A). Optionally, also specify the subscriber-id via the jms-client-id
              attribute.
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>exampleBean</ejb-name>
              <message-driven-descriptor>
              <connection-factory-jndi-name>myMDBCF</connection-factory-jndi-name>
              <jms-client-id>myClientID</jms-client-id>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              C) Target the application at the same servers that have the custom connection
              factories targeted at them.
              Notes/Limitations:
              1) If the MDB is moved from one server to another, the MDB's corresponding
              connection-factory must be moved with it.
              2) This work-around will not work if the destination is not in the same
              cluster as the MDB. (The MDB can not use the local connection factory, which
              contains the connection-id, as connection factories do not work unless they
              are in the same cluster as the destination.)
              3) This work-around will not work for non-WebLogic JMS topics.
              

  • Error of Foreign JMS server connecting to durable subscriber topic

    Weblogic server domain is trying to connect to the durable topic configured on the other weblogic domain. (Both domain are running on weblogic 9.2 platform)
    WLI 9.2 Event generator is TestPinFJ is the MDB which is trying to listen message from Foreign JMS.
    Following error we have got when I did following configuration for connecting to durable topic using foreign JMS.
    <EJB> <BEA-010061> <The Message-Driven EJB: TestPinFJ is unable to connect to the JMS destination: TestQueue. The Error was:
    java.lang.IllegalArgumentException: port out of range:-16>
    Detail configuration is as follows:
    Foreign JMS : TestFS
    General:
    JNDI Connection URL: t3://10.20.65.95:9004 TestClient123 (where TestClient123 is the client id for durable subscriber topic )
    Destinations:
    Local JNDI Name: TestQueue
    Remote JNDI Name: TestTopic
    Connection Factories :
    Local JNDI Name: TestQCF
    Remote JNDI Name: TestTCF
    My suspect is the JNDI connection URL is incorrect. Please advice how to configure JNDI conn url while connecting to durable topic with client id?

    hi Hussain,
    I am the collegue of the person created this thread.
    Thaks for the input. can u please suggest me how do we configure connectionfactory and JSM topic to durable subscription with ClientID.Shoudl th eClientID be same for JMSTopic and ConectionFactory?
    In Domain "A" I have created JMS topic with durable subscriber wioth client ID "TestClient123" and created a conenctionfacory with same client ID "TestClient123" .
    In Domain "B" i created a foreign JMS connecting to topic in Domain A using connection facatory created in Domain "A" configured as as remoteConnectionFActory.
    Also the JNDI Connection URL is : t3://10.20.65.95:9004
    "weblogic.jms.common.InvalidClientIDException: Client id, Testclient1, is in use. The reason for rejection is "The JNDI name weblogic.jms.connection.clientid.TestClient123was found, and was bound to an object of type weblogic.jms.frontend.FEClientIDSingularAggregatable : FEClientIDSingularAggregatable(SingularAggregatable(<9222810352589496374.1>:1):TestClient123)"
    Nested exception: weblogic.jms.common.InvalidClientIDException: Client id, EAIEXTTestClient123, is in use. The reason for rejection is "The JNDI name weblogic.jms.connection.clientid.TestClient123 was found, and was bound to an object of type weblogic.jms.frontend.FEClientIDSingularAggregatable : FEClientIDSingularAggregatable(SingularAggregatable(<9222810352589496374.1>:1):TestClient123)".
    weblogic.jms.common.InvalidClientIDException: Client id, EAIEXTTestClient123, is in use. The reason for rejection is "The JNDI name weblogic.jms.connection.clientid.TestClient123 was found, and was bound to an object of type weblogic.jms.frontend.FEClientIDSingularAggregatable : FEClientIDSingularAggregatable(SingularAggregatable(<9222810352589496374.1>:1):TestClient123)"
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:211)"
    IS there any chnage i need to make to get this connectivity between Domain A and B working?
    Appreciate your help on this.

  • Durable Subscriber Stops Receiving Messages

    We have a durable subscriber using an asynchronous listener that randomly stops receiving messages. After the application is restarted, messages delivery is re-activated. When the durable subscriber is in this state (where messages are not being delivered), the JMX Mbean "isActive" attributes is true. There are other durable subscribers on this same destination that receive messages as expected.
    Has anyone observed this behavior for a durable subscription?

    What is the MQ version shown at beginning of the broker log ? Could you please give more description of your application and what the subscriber clients do ?

  • Messages for Durable Subscriber are not persisted with Distributed Topic

    Setup:
              - Weblogic 8.1 SP 6 cluster with two nodes on single Sun Solaris 5.8 host
              - Distributed topic destination, separate JMS server with separate filestore for each node
              - Standalone durable JMS client connecting to distributed topic destination using specific JNDI name.
              - Messages are persistent (msg.setJMSDeliveryMode(DeliveryMode.PERSISTENT). Delivery mode override for topic destinations is set to "Persistent"
              Test:
              1) Both nodes up, starting durable topic subscriber -> durable subscriber is visible in Weblogic console -> sending X messages -> X messages are received :-)
              2) Both nodes up, killing durable topic subscriber -> durable subscriber is still visible in Weblogic console -> sending X messages -> Messages Current Count for durable subscribers is set to X -> starting JMS client again
              2a) subscribing to same node as before -> console says durable subscriber is active again -> X messages are received :-)
              2b) subscribing to other node -> durable subscriber is automatically migrated by Weblogic to this node, console says that subscriber is active, but Messages Current Count is 0 (zero) -> 0 (zero) messages are received :_|
              Where are my X messages gone?
              Should I open a call or did I misunderstand the basics?
              Thanks, Peter

    According to Bea Customer Support this is the normal behavior. If you kill a durable topic subscriber and reconnect it with the same id to another node, the old subscription is deleted and all messages still waiting to be delivered are gone.
              Lesson learned: If you need failover for the server AND client use JMS queues.
              Peter

  • Durable Subscriber MDB

    Getting the following error when creating a durable subscriber MDB to FioranoMQ:
    2/24/04 10:50 AM Error listening to 'Fiorano JMS Topic : CACHELOCALHOST'
    java.lang.InstantiationException: Error: null
         at com.evermind.server.jms.OrionServerSessionPool.getServerSessionFull(OrionServerSessionPool.java:433)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:882)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
         at java.lang.Thread.run(Thread.java:534)
    I have a standalone subscriber that works so I'm pretty sure this isn't a Fiorano issue.
    Anyone had any luck in this type of situation?

    Which versin of the appserver are using? MDB support for 3rd party JMS providers will only be supported in the next version of the appserver.

  • Durable subscriber question

    Hi,
              wls 8.1.4.
              Scenario: Durable subscriber (DS) connects to a jms distributed topic member T1.
              DS gets disconnected and has a backlog of messages.
              DS connects to jms distributed topic member T2 (on a different jms/managed server) (using the same client-id it had used when connecting to T1).
              Looks like the subscription starts afresh and the backlog (from T1) is lost.
              Is this the expected behavior. Any way we can make this DS reconnect carry forward the state (backlog) as well.
              Thanx,

    Examples that comes with the O'Reilly book on the subject can be found at http://examples.oreilly.com/javmesser
    In there you can find a couple of examples on durable subscriptions.
    For other questions you have refer to the JMS specifications http://java.sun.com/products/jms/jms1_0_2-spec.pdf

  • Durable subscribe to distributed topic

    Hi,
              The documentation states:
              ========================
              Note:      Durable subscribers (DurableTopicSubscriber) cannot be created for distributed topics. However, you can still create a durable subscription on distributed topic member and the other topic members will forward the messages to the topic member that has the durable subscription.
              =======================
              1. What is the technical reason that prevents durable subscribers to be created for distributed topics?
              2. If we create a durable subscriber to individual members of the distributed topic, what are the failover characteristics?
              a. If there is a durable subscriber to one of the physical members of the distributed topic, what happens if the server hosting the physical member dies? Lets assume we have a 2 node cluster
              b. Are the messages persisted until the server comes up or does the durable subscriber automatically migrate to the other server?
              Thanks in advance!
              regards,
              Vish Tigadi

    Hi there,
              1 - The technical requirement is to ensure that the durable subscription exists "exactly once" within the clustered destination - planned for a future release.
              2 and 2a - Durable subscriptions fail-over with their host destination.
              2b - JMS servers can automatically fail-over using "whole server" migration (as of version 9.0) per the doc, or manually fail-over using "service migration" (as of version 7.0?). In the next upcoming release (now available as a "tech preview"), we've added support for automatic service migration of JMS servers.
              Tom

  • Durable subscriber configured for the topic - reconnect policy

    Hi,
    we have Durable subscriber configured for the topic. When ever the managed server associated with the Topic is restarted, we have to restart subscriber to receive the messages again.
    we did tried using the reconnect policy to all , still we have same issue, could you please provide your suggestions.
    Susbcriber is not throwing the connect exception as well,when ever the managed server goes down also.
    thanks
    ARun

    I would suggest, if you have done so, that you set an Exception listener on the connection, or on the session using WLS extension interface, so that your client will get Exception on server failure and refresh the JMS objects (connection/session/subscriber).

  • Durable Subscriber for Uniform Distributed Topic

    Hi I created one Uniform distributed topic (UDT). And One Error topic which is also Uniform distributed topic (UDT) for the same Uniform distributed topic (UDT). Now i want all the error messages in error topic to persist. So i want to create one durable subscriber for error topic. For normal topic it is easy to create but how can i create durable sub scriber for Error Topic. Please suggest.

    Thank you Kalyan. But i don't think that will help. Or let me rephrase my question.
    Below are my observations for using Error topic for Uniform Distributed Topic (UDT) -
    1. Error topic for a UDT has to be a UDT, in the same subdeployment.
    2. It is not possible to create a durable subscriber for UDT from WLS console - there is no create button.
    We need durable subscriber to persist error messages. So as a work around I have created a dummy SOA process as a subscriber to the error UDT and turned the SOA process off.
    Do you have an idea if we can avoid creation of dummy subscriber and still persist messages in error topic (UDT) for distributed env?
    will the attribute value "Delivery Mode" = Persist help?

  • Catalog Migration Problem from 10g to 11g

    Hi,
    When i am trying to migrate catalog of 10g to 11g. They have some problems
    1. In obiee 10g (under root folder) it shows only around 5 dashboards. But actually when i am seeing in the I catalog manager of obiee 10g it shows 12 dashboards and pages.
    Can some please help me on this how to see the other dashboards and page in obiee 10g ( under root folder ).
    2. When i am trying to migrate the catalog folder in obiee 11g it also shows around 5 dashboards. And other dashboards are not seeing after migration.
    Can someone please help me on this how to see the other dashboards and pages in obiee 11g as well.

    Hi,
    In Webcat, there can be some contents that are inconsistent/invalid. And such contents have 0 byte size. Please check if dashboards files that are not visible and their corresponding .atr files have 0 byte size.
    Other possibility can be dashboards are hidden for the user-id you are using for login.
    Please mark as helpful/correct if this reply helps.
    Thanks,
    Vijay
    Edited by: user5814724 on Apr 8, 2013 4:58 AM

  • Ports problems with 10g XE

    Hello!
    I'm using Oracle 10g XE on Windows Server 2003, the installation was successfully realized.
    The problem is that I can't access to the login page : http://127.0.0.1:8080/apex . I think that the problem come from a port restriction (but I'm not sure!) : the 8080 port is certainely blocked, but I don't know how open it ...
    With Windows XP Pro, I had no problem ... ! Nevertheless I used the same anti-virus program with the same rules ... !
    Can someone help me please, I'm loosing my hair !!
    Thanks !

    Hello!
    I'm using Oracle 10g XE on Windows Server 2003, the installation was successfully realized.
    The problem is that I can't access to the login page : http://127.0.0.1:8080/apex . I think that the problem come from a port restriction (but I'm not sure!) : the 8080 port is certainely blocked, but I don't know how open it ...
    With Windows XP Pro, I had no problem ... ! Nevertheless I used the same anti-virus program with the same rules ... !
    Can someone help me please, I'm loosing my hair !!
    Thanks !

  • Problem Oracle 10g database Installation on Windows 2003 Server

    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad Shoaib

    898118 wrote:
    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad ShoaibOracle really doesn't like to be installed into directories with spaces in their names.

  • Problem with 10g and 9i in one machine

    Hello,
    I installed 10g in a pc where 9i is already installed. It was installed in its own home directory. My problem is that when I try to access it using Enterprise Manager, or Sql*Plus, or Developer, I get either the service name could not be resolved, or cannot allocate a dedicated server. The service is up and running.
    The curious thing is that I can access it with the command from a command window:
    sqlplus
    'scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=CAC403JN.EBOT.CA)(PO
    RT=1521)))(CONNECT_DATA=(ORACLE_SID=ANEC)))'
    Both the 9i and 10g have the same HOST and PORT but different SID.
    How do I fix my configuration so I can access 10g using the using tools?
    Help.
    Thanks,
    gk

    If you are using local naming (tnsnames.ora file) and you have multiple Oracle Homes, one of two things has to happen
    1) Every TNS entry has to be duplicated in each tnsnames.ora file.
    2) You need to create a TNS_ADMIN environment variables that points at the location of the single tnsnames.ora file that all applications should use.
    My personal preference is to go with option 2.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • MBPro Won't boot from CD

    Hello there, I just brought home a brand new MacBook Pro. This was actually a replacement Apple gave me since my last computer wouldn't work. When I opened the computer up for the first time and went to set everything up, I chose the option to restor

  • Running 10.4.6 on a G3 iBook and my Adddress Book won't open

    sorry, i posted this as a 'reply'-- and have re-posted it: I have a G3 iBook and my Address Book 4.0 won't open. I have tried re-installing from Tiger but I now have an OS later than Tiger, and am reluctant to go back. Also I don't know how to select

  • How do you get spaces to show everything in that space so you can drag...

    Stuff into other spaces?

  • Error 3014 with iOS 5, can't restore iPhone HELP!

    Basically as the title suggests. Downloaded and tried to update iPhone 4 with iOS 5 and it didnt work. Needed restoring but that comes up with the 3014 error. Happened to my iPad aswell. Redownloaded iTunes and that didint work as well as restarting.

  • How to create a supervised model

    I am currently using the Data Mining plug-in for Excel 2010 and want to perform a Logistic Regression on my continuously variable data (see sample below). I need to be able to specify my testing and training sets instead of letting them be sampled ra