Announcement Announcement Module
Collapse
No announcement yet.
Job Statistics Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    You could implement that yourself with a custom Step or listener. We don't provide anything like that because it's kind of a runtime concern, not a programming model or configuration one.

    Comment


    • #17
      spring batch within web application

      Thanks a lot.
      I want to use Spring Batch within a web application. Following is my plan: I will hit a URL, it will invoke a servlet wherein i planned to launch a job. Can i write the same logic of QuartzBatchLauncher in my servlet?
      Or what is the correct way to implement this? Could you please give me a step by step explanation to this?

      Originally posted by Dave Syer View Post
      You could implement that yourself with a custom Step or listener. We don't provide anything like that because it's kind of a runtime concern, not a programming model or configuration one.

      Comment


      • #18
        Launch spring batch job from servlet

        Thanks a lot.
        I need an urgent help. Please help me on this...
        I want to launch a Spring Batch job on a URL hit (within a web application). Following is my plan: I will hit a URL, so a servlet will get executed wherein i will launch the job. I just want to launch the job from servlet. I do not want any scheduler here. The servlet should return a result to next page after completion of the job. I created a dynamic-web-project and imported the spring batch samples. (I am able to execute the samples as stand-alone, using commandlinejobrunner.) I created a servlet also. How can i launch a job from this servlet? Would you please send me the code snippet to launch a job from the servlet?

        Comment


        • #19
          Wouldn't it be better to make your servlet return immediately with information for the user (a blocking servlet isn't a very nice UI or SO citizen)? I don't think you need any more code samples - you have everything you need already. Just inject a JobLauncher into your web-tier. The closest example in Spring Batch samples is actually the JMX demo. If you need help with Spring and web applications, try reading the Spring user guide and/or posting in the Web forum.

          Comment


          • #20
            one real scenario

            I have a scenario as described follows:
            I have 4 tables(Table A,B,C and D). The relationship between tables are as follows:
            A-->B is one-to-many relation(For each row in A, there can be any number of records in B. In other way, B has a reference to A)
            C-->D is one-to-many relation(same as above).

            A & B tables contains actual data. I want a batch job which will copy records from A to C and B to D based on some conditions.
            Conditions are on some field values in table A:
            If one of the field in table A(say creationDate) is greater than "last batch executed date", then copy those records into table C. Copy the records from table B which are refering to the those records in A, into table D.

            Could you please suggest the best strategy/approach to solve this in detail? (step by step)

            Comment


            • #21
              Please do not ignore my previous query. I have a side effect with one prevoius fix.

              As per your comment, I have removed lobHandler and incrementerParent bean def from data-source-context.xml because both were giving the same errors.
              But in order to run parallelJob.xml, we required "incrementerParent" bean def.
              So if i added this bean def into data-source-context.xml, it is giving the same old classnotfoundexception. If i dont add bean def, i am getting the following error:
              Error creating bean with name 'org.springframework.batch.sample.item.writer.Stag ingItemWriter#2f48d2' defined in class path resource [jobs/parallelJob.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializati onException: Initialization of DAO failed; nested exception is java.lang.IllegalArgumentException: DataFieldMaxValueIncrementer is required - set the incrementer property in the StagingItemWriter

              Would you please give me a hint to solve this?

              Originally posted by Dave Syer View Post
              From batch-oracle.properties in the samples project:

              Code:
              batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
              Did you include that file in your context (the easiest way is by setting a System property environment=oracle)?

              Actually the lob handler is only there to support very old versions of Oracle, and we'll be removing it from the samples at some point anyway. If you have Oracle 10g or above you don't need it so you can root out the bean definition that is causing problems and delete it.

              Comment


              • #22
                please help me on this.


                Originally posted by johny_z View Post
                I have a scenario as described follows:
                I have 4 tables(Table A,B,C and D). The relationship between tables are as follows:
                A-->B is one-to-many relation(For each row in A, there can be any number of records in B. In other way, B has a reference to A)
                C-->D is one-to-many relation(same as above).

                A & B tables contains actual data. I want a batch job which will copy records from A to C and B to D based on some conditions.
                Conditions are on some field values in table A:
                If one of the field in table A(say creationDate) is greater than "last batch executed date", then copy those records into table C. Copy the records from table B which are refering to the those records in A, into table D.

                Could you please suggest the best strategy/approach to solve this in detail? (step by step)

                Comment


                • #23
                  Hi Dave Syer/lucasward

                  Would you please help me.

                  I have a scenario as described below:
                  I have 4 tables(Table A,B,C and D). The relationship between tables are as follows:
                  A-->B is one-to-many relation(For each row in A, there can be any number of records in B. In other way, B has a reference to A)
                  C-->D is one-to-many relation(same as above).

                  A & B tables contains actual data. I want a batch job which will copy records from A to C and B to D based on some conditions.
                  Conditions are on some field values in table A:
                  If one of the field in table A(say creationDate) is greater than "last batch executed date", then copy those records into table C. Copy the records from table B which are refering to the those records in A, into table D.

                  Could you please suggest the best strategy/approach to solve this in detail? (step by step)

                  Please let me know if the above scenario is not clear .

                  Comment


                  • #24
                    It is clear. Maybe if you thought about the problem a bit and compared it to existing samples and descriptions in the user guide, you would find a way to solve it. I suggest you start with one of the Jdbc*ItemReaders and a query on table A.

                    N.B. this is a community forum and not a support line. By all means continue to use it, and I hope you have a great experience, but I'm guessing you will have a better one if you just remember a few things. All of the Spring Batch developers have day jobs and we are not paid to work on forum posts. Please bear this in mind when you are asking your questions. If you need more care and attention and guaranteed response times on support questions, please look into buying commercial support for Spring Enterprise.

                    Comment

                    Working...
                    X