title,body,link,tags,view_count,is_answered,score,answer_count
Python integration / regression testing framework,"<p>I'm just wondering whether there is any good framework for doing integration / regression tests in Python? I want to run all modules on large input data files (sensor measurements) to ensure that new changes in the code have not introduced any new defect (for every commit). Of course, I could implement such tests + reporting by myself in some pytest sub directory, but maybe there are some out of the box solutions?</p>
<p>Thanks!</p>
<p>Cheers,
Alexey</p>
",https://stackoverflow.com/questions/68165588/python-integration-regression-testing-framework,"['python', 'pytest', 'integration-testing', 'regression-testing']",958,True,1,1
Sanity Testing vs Regression Testing?,"<p>I did some researches and i found out that :</p>
<blockquote>
<p><strong>Sanity Testing</strong> is the type of software testing, that is performed after a software build is received with changes  in functionality and code. Sanity testing is performed in order to assure that the bugs have been fixed and there are no other bugs originated with the new changes.</p>
</blockquote>
<blockquote>
<p><strong>Regression testing</strong> is testing existing software features to make sure that a change or addition hasn't broken any existing functionality</p>
</blockquote>
<p>I can't see the difference between these two testing techniques?
Any clarification?</p>
",https://stackoverflow.com/questions/67559354/sanity-testing-vs-regression-testing,"['testing', 'automated-tests', 'terminology', 'definition']",865,True,0,1
"How do I assign multiple user subset of test suite in azure devops automatically, instead of manually selected each tester in regression testing","<p><a href=""https://i.stack.imgur.com/nAxpA.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/nAxpA.png"" alt=""enter image description here"" /></a> I have to manually assign test cases subset to each tester I want a way to automatically assign subset of test suite to multiple user and there must be multiple test subsets.</p>
<p>Sorry for my poor knowledge I have just migrated to devops</p>
<p>As you can see there are 3000+ test cases it is inefficient for me to assign them to a single person so i need randomly assign 100-200 test cases to a user.</p>
<p>Is there any other way on Azure Devops.</p>
",https://stackoverflow.com/questions/69019806/how-do-i-assign-multiple-user-subset-of-test-suite-in-azure-devops-automatically,['azure-devops'],516,False,0,1
BackstopJs. Am I able to use a png or svg as the reference URL?,"<p>I am currently learning BackstopJs for visual regression testing. However, our files for the reference are based in figma and are difficult to grab the exact screen I need (we show several views in one file). Is there a way for me to use a png as the referenceUrl?</p>
<p>Thank you!</p>
",https://stackoverflow.com/questions/69017862/backstopjs-am-i-able-to-use-a-png-or-svg-as-the-reference-url,['backstop.js'],180,True,0,1
Upgrading Bootstrap,"<p>I'm upgrading bootstrap 3.3.6 to 3.4.1. First need to first I need to find all the places(HTML elements) that use bootstrap 3.3.6 so I can do my regression testing covering those elements. Is there a way I can find all the bootstrap references?</p>
<p>This is a .net application with razor views
Thanks</p>
",https://stackoverflow.com/questions/66810886/upgrading-bootstrap,"['css', '.net', 'twitter-bootstrap-3', 'frontend', 'razor-pages']",93,False,0,1
How to ignore website console error in playwright tests?,"<p>I'm using playwright for some visual regression testing. On the site in question there third-party scripts that might throw a console error if blocked by the user due to privacy concerns. My playwright tests fail due to those console errors</p>
<p>Is there a way to ignore some or all website console errors so my regression tests pass?</p>
",https://stackoverflow.com/questions/66222063/how-to-ignore-website-console-error-in-playwright-tests,['playwright'],2145,True,2,1
How to configure ReportPortal for Android Studio?,"<p>I'm using Android studio and gradle to build apk and perform regression testing. I'm supposed to explore ways of integrating ReportPortal to the android project for generating reports. However I didn't find Android Platform listed in <a href=""https://reportportal.io/installation"" rel=""nofollow noreferrer"">https://reportportal.io/installation</a></p>
<p>I'm open to suggestions about trying out other reporting tools for android studio as well.</p>
",https://stackoverflow.com/questions/67686574/how-to-configure-reportportal-for-android-studio,"['java', 'android', 'android-studio', 'reportportal']",204,True,-1,1
Jenkins trigger build via branch merge on reappearing branch,"<p>I have three branches <code>master</code>, <code>b1</code> and <code>b2</code>. The development for each project in our group works as follows: All development is pulled from and pushed to <code>b2</code>, we merge it into <code>b1</code> as soon as there is no more code to develop, we do regression testing with the code in <code>b1</code>, deploy it manually using Jenkins and finally merge <code>b1</code> it into master.
Now, because I am tired of all the merging and manual stuff, I want to use Jenkins all the way, i.e., a build is triggered when a change occurs in <code>b1</code>, i.e., when the code is done, regression testing is launched and we have the final tested build with docs in the end.</p>
<p>I know how to set up a trigger when there is a change in a branch but I am wondering how to do it since the branch <code>b1</code> to which the trigger is hooked, is also merged afterwards (manually) into <code>master</code>. Is the this again a trigger for a build? And if I recreate the branch at a later time, does Jenkins simply recognize that it has to work with the new branch (identical name as the old one)?</p>
",https://stackoverflow.com/questions/69795006/jenkins-trigger-build-via-branch-merge-on-reappearing-branch,"['git', 'jenkins']",158,False,0,0
Migrate Consumption Logic App to Standard,"<p>This is a follow-on to <a href=""https://stackoverflow.com/questions/69915297/how-to-migrate-and-existing-logic-app-from-consumption-model-to-the-new-standard"">this question</a></p>
<p>That answer covers a basic case, but does not work if the workflow includes DB access, at least that is what I found, for SQL Server. Further, the only SQL Server operation offered in Standard is Execute Query, which is a significant dis-improvement from Consumption</p>
<p>So far, I have not been able to find any way to achieve this migration without manually re-coding the workflow - both time-consuming and risky, necessitating extensive regression testing</p>
",https://stackoverflow.com/questions/69939602/migrate-consumption-logic-app-to-standard,"['migration', 'azure-logic-apps']",908,True,0,1
Sanity Testing vs Regression Testing?,"<p>I did some researches and i found out that :</p>
<blockquote>
<p><strong>Sanity Testing</strong> is the type of software testing, that is performed after a software build is received with changes  in functionality and code. Sanity testing is performed in order to assure that the bugs have been fixed and there are no other bugs originated with the new changes.</p>
</blockquote>
<blockquote>
<p><strong>Regression testing</strong> is testing existing software features to make sure that a change or addition hasn't broken any existing functionality</p>
</blockquote>
<p>I can't see the difference between these two testing techniques?
Any clarification?</p>
",https://stackoverflow.com/questions/67559354/sanity-testing-vs-regression-testing,"['testing', 'automated-tests', 'terminology', 'definition']",865,True,0,1
.net core API non regression test best practices,"<p>I'm currently working on many .NET Core API projects and encountered a future possible regression.
How do you guys prevent this situation ?</p>
<p>Here's my architecture :</p>
<ol>
<li>API project</li>
<li>BusinessLayer</li>
<li>API.UnitTests (references 2))</li>
<li>API.IntegrationTests (references 1 #for the casts))</li>
</ol>
<p>An integration test example :</p>
<pre><code>[Fact]
    public async Task TestGetAll()
    {
        // Arrange
        var query = &quot;api/v1/xxx/getall&quot;;

        // Act
        var response = await _AuthorizedClient.GetAsync(query);

        // Assert
        Assert.True(response.IsSuccessStatusCode);

        var results = JsonConvert
            .DeserializeObject&lt;List&lt;MyResult&gt;&gt;(await response.Content.ReadAsStringAsync());
        Assert.True(results.Any());
        //Assert.AnythingOn(results);
    }
</code></pre>
<p>Considering the next version and/or my [colleague] maintenance; with my deserializing cast, an update of the <code>MyResult</code> object might be hidden and create a production regression.</p>
<p>I've tried to do my integration test with the dynamic keyword and without casting but it take my much effort.</p>
<p>How do you deal with this situation ?
Are there any best practices ?</p>
<p>[Edit] After some search, I've found this article <a href=""https://www.microsoft.com/en-us/research/publication/differential-regression-testing-for-rest-apis/"" rel=""nofollow noreferrer"">Differential Regression Testing for REST APIs</a> which looks quite interesting</p>
",https://stackoverflow.com/questions/68525938/net-core-api-non-regression-test-best-practices,['.net-core'],76,False,0,1
Ignore directory for one docker file but not another,"<p>I have multiple Dockerfiles in my project.  One Dockerfiles builds the publishable image.  The other builds an image based on that artifact with extra data for regression testing.  The extra data is large, and slows down sending the context to the docker daemon for building the publishable image.</p>
<p>I am aware of <code>.dockerfile</code>, but I only want to ignore the large directory with one Dockerfile.  Is there a way to do something like</p>
<pre><code># Build publishable image
docker build --ignore-file .dockerignore-publish docker/Dockerfile-publish -t publish .
# Build regression image
docker build --ignore-file .dockerignore-regression docker/Dockerfile-regression -t regression .
</code></pre>
<p>where <code>.dockerignore-regression</code> does not ignore the regression data directory, but <code>.dockerignore-publish</code> does?</p>
<p>I suspect the standard answer is to only have one Dockerfile per project, or to change the root directory so only the regression build finds the regression data.  Those could work, but are awkward in this case.  A per-dockerfile solution would be the simplest option.</p>
",https://stackoverflow.com/questions/66533792/ignore-directory-for-one-docker-file-but-not-another,['docker'],62,False,0,2
How to use ByteArray for object serialisation and deserialisation,"<h3>Context</h3>
<p>I'm doing my student project and building a testing tool for regression testing.</p>
<p>Main idea: capture all constructors/methods/functions invocations using AOP during runtime and record all data into a database. Later retrieve the data, run constructors/methods/functions in the same order, and compare return values.</p>
<h3>Problem</h3>
<p>I'm trying to serialize objects (and arrays of objects) into a byte array, record it into PostgreSQL as a blob, and later (in another runtime) retrieve that blob and deserialize it back to object. But when I deserialize data in another runtime it changes and, for example, instead of <code>boolean</code>, I retrieve <code>int</code>. If I do exactly the same operations in the same runtime (serialize - insert into the database - SELECT from the database - deserialize) everything seems to work correctly.</p>
<p>Here is how I record data:</p>
<pre><code>   private void writeInvocationRecords(InvocationData invocationData, boolean isConstructor) {
        final List&lt;InvocationData&gt; invocationRecords = isConstructor ? constructorInvocationRecords : methodInvocationRecords;
        final String recordsFileName = isConstructor ? &quot;constructor_invocation_records.json&quot; : &quot;method_invocation_records.json&quot;;

        byte[] inputArgsBytes = null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream out = null;
        try {
            out = new ObjectOutputStream(bos);
            out.writeObject(invocationData.inputArgs);
            out.flush();
            inputArgsBytes = bos.toByteArray();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bos.close();
            } catch (IOException ex) {
                // ignore close exception
            }
        }

        byte[] returnValueBytes = null;
        ByteArrayOutputStream rvBos = new ByteArrayOutputStream();
        ObjectOutputStream rvOut = null;
        try {
            rvOut = new ObjectOutputStream(rvBos);
            rvOut.writeObject(invocationData.returnValue);
            rvOut.flush();
            returnValueBytes = rvBos.toByteArray();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                rvBos.close();
            } catch (IOException ex) {
                // ignore close exception
            }
        }
        invocationRecords.add(invocationData);
        if (invocationRecords.size() &gt;= (isConstructor ? CONSTRUCTORS_CACHE_SIZE : METHODS_CACHE_SIZE)) {
            List&lt;InvocationData&gt; tempRecords = new ArrayList&lt;InvocationData&gt;(invocationRecords);
            invocationRecords.clear();
            try {
                for (InvocationData record : tempRecords) {
                    SerialBlob blob = new javax.sql.rowset.serial.SerialBlob(inputArgsBytes);
                    SerialBlob rvBlob = new javax.sql.rowset.serial.SerialBlob(returnValueBytes);
                    psInsert.setString(1, record.className);
                    psInsert.setString(2, record.methodName);
                    psInsert.setArray(3, conn.createArrayOf(&quot;text&quot;, record.inputArgsTypes));
                    psInsert.setBinaryStream(4, blob.getBinaryStream());
                    psInsert.setString(5, record.returnValueType);
                    psInsert.setBinaryStream(6, rvBlob.getBinaryStream());
                    psInsert.setLong(7, record.invocationTimeStamp);
                    psInsert.setLong(8, record.invocationTime);
                    psInsert.setLong(9, record.orderId);
                    psInsert.setLong(10, record.threadId);
                    psInsert.setString(11, record.threadName);
                    psInsert.setInt(12, record.objectHashCode);
                    psInsert.setBoolean(13, isConstructor);
                    psInsert.executeUpdate();
                }
                conn.commit();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

</code></pre>
<p>Here is how I retrieve data:</p>
<pre><code>        List&lt;InvocationData&gt; constructorsData = new LinkedList&lt;InvocationData&gt;();
        List&lt;InvocationData&gt; methodsData = new LinkedList&lt;InvocationData&gt;();

        Statement st = conn.createStatement();
        ResultSet rs = st.executeQuery(SQL_SELECT);
        while (rs.next()) {

            Object returnValue = new Object();
            byte[] returnValueByteArray = new byte[rs.getBinaryStream(7).available()];
            returnValueByteArray = rs.getBytes(7);
            final String returnType = rs.getString(6);
            ByteArrayInputStream rvBis = new ByteArrayInputStream(returnValueByteArray);
            ObjectInputStream rvIn = null;
            try {
                rvIn = new ObjectInputStream(rvBis);
                switch (returnType) {
                    case &quot;boolean&quot;:
                        returnValue = rvIn.readBoolean();
                        break;
                    case &quot;double&quot;:
                        returnValue = rvIn.readDouble();
                        break;
                    case &quot;int&quot;:
                        returnValue = rvIn.readInt();
                        break;
                    case &quot;long&quot;:
                        returnValue = rvIn.readLong();
                        break;
                    case &quot;char&quot;:
                        returnValue = rvIn.readChar();
                        break;
                    case &quot;float&quot;:
                        returnValue = rvIn.readFloat();
                        break;
                    case &quot;short&quot;:
                        returnValue = rvIn.readShort();
                        break;
                    default:
                        returnValue = rvIn.readObject();
                        break;
                }
                rvIn.close();
                rvBis.close();

            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } finally {
                try {
                    if (rvIn != null) {
                        rvIn.close();
                    }
                } catch (IOException ex) {
                    // ignore close exception
                }
            }

            Object[] inputArguments = new Object[0];
            byte[] inputArgsByteArray = new byte[rs.getBinaryStream(5).available()];
            rs.getBinaryStream(5).read(inputArgsByteArray);

            ByteArrayInputStream bis = new ByteArrayInputStream(inputArgsByteArray);
            ObjectInput in = null;
            try {
                in = new ObjectInputStream(bis);
                inputArguments = (Object[])in.readObject();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } finally {
                try {
                    if (in != null) {
                        in.close();
                    }
                } catch (IOException ex) {
                    // ignore close exception
                }
            }

            InvocationData invocationData = new InvocationData(
                    rs.getString(2),
                    rs.getString(3),
                    (String[])rs.getArray(4).getArray(),
                    inputArguments,
                    rs.getString(6),
                    returnValue,
                    rs.getLong(8),
                    rs.getLong(9),
                    rs.getLong(10),
                    rs.getLong(11),
                    rs.getString(12),
                    rs.getInt(13)
                    );
            if (rs.getBoolean(14)) {
                constructorsData.add(invocationData);
            } else {
                methodsData.add(invocationData);
            }
        }
        st.close();
        rs.close();
        conn.close();

</code></pre>
",https://stackoverflow.com/questions/67870557/how-to-use-bytearray-for-object-serialisation-and-deserialisation,"['java', 'serialization']",668,True,2,1
PowerShell 5.1 v PWSH Out-File,"<p>More of a curiosity question. Has anyone noticed a difference between PS(5.1) vs pwsh(7.2.1) and using the <code>Out-File</code> cmdlet?</p>
<p>Im talking more along the lines of you run a script in PS and it outputs a file <code>test.log</code> in this instance using <code>out-file</code>. And then you run the same script in <code>pwsh</code> and outputing to the same file with <code>-Append</code> and the text just shows as japanese(?) characters.</p>
<pre><code>PowerShell 5 Test Text
PowerShell 5 Test Text
潐敷卲敨汬㜠吠獥⁴敔瑸਍潐敷卲敨汬㜠吠獥⁴敔瑸਍
</code></pre>
<p>The last line is what appears when running <code>pwsh</code>:</p>
<pre><code>&quot;PowerShell 7 Test Text&quot; | Out-File &quot;C:\Source\Scripts\ScriptLog\test.log&quot; -Append
</code></pre>
<p>When doing the reverse <code>pwsh</code> to <code>PowerShell</code> the text appears, but it is formatted with spaces:</p>
<pre><code>PowerShell 7 Test Text
P o w e r S h e l l   5   T e s t   T e x t 
</code></pre>
<p>Do the two programs just format text files differently? Or is there a way to have them format the same?</p>
<p>We are slowly working <code>pwsh</code> into being the norm but have to do quite a bit of regression testing to ensure things work properly and this is one thing I've been seeing that is not working.</p>
",https://stackoverflow.com/questions/70422304/powershell-5-1-v-pwsh-out-file,"['powershell', 'text', 'formatting', 'powershell-core']",102,False,0,2
Cucumber doesn&#39;t generate steps properly,"<p>I'm very new to BDD and cucumber testing. I have tried to combine BDD cucumber testing with Rest Assured and I'm facing some issues and need your help</p>
<p>I have a very simple feature file</p>
<pre><code>Feature: End to end test for add category feature

  Scenario Outline:Successful addition of a new category
    When I try to add a category with request file &lt;requestFile&gt;
    Then I receive HTTP status &lt;status&gt;
    And The response matches response from file &lt;responseFile&gt;
    Examples:
      | requestFile                                               | status | responseFile
      | &quot;json-files/category/requests/category.json&quot;              | 201    | &quot;json-files/common/expected-responses/requestSuccessfullyProcessed.json&quot;
      | &quot;json-files/category/requests/category-name-missing.json&quot; | 400    | &quot;json-files/category/expected-responses/category-name-missing.json&quot;
</code></pre>
<p>My plan is very simple. I have a pair of a request and a response file and I'm performing end-to-end regression testing.</p>
<p>It's throwing an error in the last step where it's supposed to validate the response file saying step undefined. When I uncommented my step definition methods and tried to let cucumber generate the steps I noticed that this is what it is generating</p>
<pre><code>Step undefined
You can implement this step and 2 other step(s) using the snippet(s) below:

@When(&quot;I try to add a category with request file {string}&quot;)
public void i_try_to_add_a_category_with_request_file(String string) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@Then(&quot;I receive HTTP status {int}&quot;)
public void i_receive_http_status(Integer int1) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@Then(&quot;The response matches response from file &lt;responseFile&gt;&quot;)
public void the_response_matches_response_from_file_response_file() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
</code></pre>
<p>Notice that the last method somehow didn't generate the {string} argument and this is the reason even when I define the steps, it's not working.</p>
<p>I have no clue if I have made any mistakes in the feature file. A bit of help would be great</p>
",https://stackoverflow.com/questions/67361463/cucumber-doesnt-generate-steps-properly,"['cucumber', 'regression', 'bdd']",103,False,1,0
Feature selection for Logistic Regression,"<p>Both <a href=""https://en.wikipedia.org/wiki/Kaplan%E2%80%93Meier_estimator#:%7E:text=The%20Kaplan%E2%80%93Meier%20estimator%2C%20also,amount%20of%20time%20after%20treatment."" rel=""nofollow noreferrer"">Kaplan Meier</a> method and Logistic Regression have their own feature selections. I want to use another method to pick best features for example, back stepwise feature selection. Is it possible to use this sort of methods instead or not.</p>
<p>My data acquires more than 130 features and about 3000 individuals. Since it is medical [cancer] data I don't want to use simple methods.</p>
<p>Further information about the project can be seen here and it is in order of what should I do:</p>
<ol>
<li>preprocessing the data</li>
<li>separating them for test and train</li>
<li>Data imputation for train data</li>
<li>Feature selection by train data</li>
<li>Training the models which are <strong>Kaplan Meier</strong> and <strong>Logistic Regression</strong></li>
<li>Testing the model</li>
</ol>
<p>Pleas inform me that is it wrong to use any other feature selection for them or not?
I can use any tip about the model which I have listed too.</p>
",https://stackoverflow.com/questions/66604104/feature-selection-for-logistic-regression,"['logistic-regression', 'feature-selection']",249,True,0,1
How to detect if Google Maps iframe finished loading,"<p>If one has an Google Maps iFrame like <code>https://www.google.com/maps/embed?...</code> on a page a simple <code>document.ready</code> won't work as the iframe will only load its content if it is in the visible window portion. Thus scrolling the page to the bottom will init the loading asynchronously.</p>
<p><strong>However how can one test if a Google Maps iFrame has finished all its loading and loading animation (jQuery or plain JavaScript)?</strong></p>
<p>Background:</p>
<p>Using CodeceptJS we do visual regression testing doing full page screenshots. However the screenshots differ as the iframe is not fully loaded (thus would be loaded differently fast for the two screenshots by random).</p>
<p>A simple <code>scrollToPageBottom</code> inits it and a <code>wait(10)</code> will work. However it should just wait as long as necessary to reduce CI pipeline duration with hundreds of tests. As the Playwright helper doesn't offer this natively it seems running a JavaScript command seems more suitable. As all underlying sites use jQuery this can be used to ease complexity.</p>
",https://stackoverflow.com/questions/70013007/how-to-detect-if-google-maps-iframe-finished-loading,"['javascript', 'jquery', 'iframe', 'playwright', 'codeceptjs']",348,False,0,0
"Using Python 3 &quot;requests&quot; package to access web server with IP V6 address: works with W10, not with Rasberry Pi OS","<p>We have a device currently under development that we want to test for different features and protocols. One of the features is this device has an embedded HTTP(S) server and we want to perform regression testing when we make changes in the device source code. for that purpose we use Jenkins and a Raspberry Pi 4 (4 GB) as slave with PyTest as test framework, although our development environment is done with Windows 10.</p>
<p>We noticed a problem: when trying to connect to the device HTTP server with the IP V6 address on the RPi, we get a &quot;[Errno 22] Invalid argument&quot; error.</p>
<p>We reduced the test to a minimal Python 3 script to no avail: the same script works on Windows 10 but not on RPi.</p>
<p>Here is the script:</p>
<pre><code>import os
import requests

ipv6_address = 'fe80::211:ff:fe4c:e565'

os.environ['no_proxy'] = 'localhost,foobar.com,192.168.10.*,{},[{}]'.format(ipv6_address, ipv6_address)

r = requests.get('https://[{}]/'.format(ipv6_address), verify=False, timeout=5)

print(r.status_code)
print(r.headers)
print(r.url)
</code></pre>
<p>Here are the results for Windows 10 (version 2004 19041.867):</p>
<pre><code>$ python --version
Python 3.7.7

$ python ~/test_req.py
C:\Python37-32\lib\site-packages\urllib3\connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'fe80::211:ff:fe4c:e565'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
200
{'Server': '', 'Connection': 'Keep-Alive', 'Keep-Alive': '', 'Persist': '', 'Content-Type': 'text/html', 'Content-Length': '1429', 'Last-Modified': 'FRI JUL 07 16:43:06 2017', 'Etag': '&quot;21D47F50-00000595-595FBA1A&quot;'}
https://[fe80::211:ff:fe4c:e565]/
</code></pre>
<p>Result for Raspberry Pi (Linux raspberrypi 5.4.83-v7l-ALADDIN+ #1 SMP Tue Feb 9 14:23:45 CET 2021 armv7l GNU/Linux) :
[NOTE: <em>we have compiled a specific version of Linux for the Ixxat SocketCAN driver from the default kernel configuration, except the name</em>]</p>
<pre><code>$ python3 --version
Python 3.7.3

$ python3 ~/test_req.py
Traceback (most recent call last):
  File &quot;/usr/lib/python3/dist-packages/urllib3/connection.py&quot;, line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File &quot;/usr/lib/python3/dist-packages/urllib3/util/connection.py&quot;, line 80, in create_connection
    raise err
  File &quot;/usr/lib/python3/dist-packages/urllib3/util/connection.py&quot;, line 70, in create_connection
    sock.connect(sa)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/lib/python3/dist-packages/urllib3/connectionpool.py&quot;, line 600, in urlopen
    chunked=chunked)
  File &quot;/usr/lib/python3/dist-packages/urllib3/connectionpool.py&quot;, line 343, in _make_request
    self._validate_conn(conn)
  File &quot;/usr/lib/python3/dist-packages/urllib3/connectionpool.py&quot;, line 841, in _validate_conn
    conn.connect()
  File &quot;/usr/lib/python3/dist-packages/urllib3/connection.py&quot;, line 301, in connect
    conn = self._new_conn()
  File &quot;/usr/lib/python3/dist-packages/urllib3/connection.py&quot;, line 168, in _new_conn
    self, &quot;Failed to establish a new connection: %s&quot; % e)
urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.VerifiedHTTPSConnection object at 0xb6369c30&gt;: Failed to establish a new connection: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/adapters.py&quot;, line 449, in send
    timeout=timeout
  File &quot;/usr/lib/python3/dist-packages/urllib3/connectionpool.py&quot;, line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File &quot;/usr/lib/python3/dist-packages/urllib3/util/retry.py&quot;, line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='fe80::211:ff:fe4c:e565', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0xb6369c30&gt;: Failed to establish a new connection: [Errno 22] Invalid argument'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/pi/test_req.py&quot;, line 9, in &lt;module&gt;
    r = requests.get('https://[{}]/'.format(ipv6_address), verify=False, timeout=5)
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/api.py&quot;, line 76, in get
    return request('get', url, params=params, **kwargs)
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/api.py&quot;, line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/sessions.py&quot;, line 542, in request
    resp = self.send(prep, **send_kwargs)
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/sessions.py&quot;, line 655, in send
    r = adapter.send(request, **kwargs)
  File &quot;/home/pi/.local/lib/python3.7/site-packages/requests/adapters.py&quot;, line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='fe80::211:ff:fe4c:e565', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0xb6369c30&gt;: Failed to establish a new connection: [Errno 22] Invalid argument'))
</code></pre>
<p>We would like to know whether someone has an idea of the source of this &quot;invalid argument&quot; error.</p>
",https://stackoverflow.com/questions/67332452/using-python-3-requests-package-to-access-web-server-with-ip-v6-address-works,"['python-3.x', 'python-requests', 'ipv6', 'raspberry-pi4']",174,False,1,0
How to use &quot;Requirement-based suite&quot; (Azure DevOps) when testing same user story in multiple environments,"<p>I relate testing to the user stories by creating a requirement-base suite in ADO. When I do this, the user story shows this beaker on the user story, indicating whether testing passed, failed, etc.:</p>
<p><a href=""https://i.stack.imgur.com/JkpsE.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/JkpsE.png"" alt=""enter image description here"" /></a></p>
<p>I've noticed if you relate multiple requirement-based suites to the same user story, the newest testing results overwrites what the beaker shows. For example, in my case, stories progress from lower environments to higher environments (in my instance; dev, QA (functional testing), UAT (regression testing), prod). I can't use the same requirement-based suite for both QA and UAT because I'd have to reset the tests which would lose the results of the lower environment. So, I have to create a new requirement-based suite for the higher environment and relate it to the same user story. When I do this, the new suite results overwrites the results for the lower environment when looking at the beaker. In other words, if I have one test in QA and one in UAT, both related to the user story, the beaker will only reflect one test, not both.</p>
<p>What I think should happen is the beaker shows the testing from the lower and higher environment.</p>
<p>Am I doing this right?</p>
",https://stackoverflow.com/questions/67306873/how-to-use-requirement-based-suite-azure-devops-when-testing-same-user-story,"['testing', 'azure-devops', 'manual-testing']",312,False,0,1
"Parse XML with ampersand (&amp;) and &lt;, &gt; with c# on .net framework (can&#39;t control source)","<p>we have a series of XML data files coming from mainframe programs. These are parsed by .Net processes downstream. Some of the inner text fields contain characters like &amp; that need to be escaped</p>
<p>Unfortunately, we can't actually fix all the programs. When a bad &amp;,&gt;, or &lt; comes in .. the fix is to ask the users to edit the mainframe data and spell out the characters! So solutions like <a href=""https://stackoverflow.com/questions/17423495/how-to-solve-ampersand-conversion-issue-in-xml"">this answer</a> won't work.</p>
<p>Some of the program escape their xml properly, e.g., they will replace &amp; in the data with <code>&amp;amp;</code> and escape the &lt; and &gt; as well. So solutions like <a href=""https://stackoverflow.com/questions/1473826/parsing-xml-with-ampersand"">this answer won't</a> work either! 😡</p>
<p>One thing I could do is to write a preprocessor that follows rules like this:</p>
<ul>
<li><p>amp Strategy:</p>
<p>Consider an &amp; followed by characters and ; with no spaces an escape
sequence</p>
<p>Test it in an separate xml dom</p>
<p>If it works leave it</p>
<p>If it doesn't, escape the &amp; with <code>&amp;amp;</code></p>
</li>
<li><p>gt/lt strategy</p>
<p>Keep track of the last tag you saw.</p>
<p>if you see &gt; outside of a tag, escape it with <code>&amp;gt;</code></p>
<p>if you see &lt; outside of a tag, this is a little harder</p>
<ul>
<li><p>read ahead and look for closing &gt;</p>
</li>
<li><p>if there was no / right before it (no non-space since), add one</p>
</li>
<li><p>try to parse it in a new dom (easier than parsing spacing, attributes, in/out of them etc.</p>
</li>
<li><p>error - escape it.</p>
</li>
</ul>
</li>
</ul>
<p>Don't get me wrong, implementing my preprocessor would be a fun coding experience, but I am very busy, and regression testing, fixing what I forgot, and maturing it would blow our budget for this project.</p>
<p>Fortunately, we see that in modern HTML, this is already implemented. As Mark comments in one of my linked answers, <em>&quot;HTML5 allows you to leave it unescaped, but only when the data that follows does not look like a valid character reference&quot;</em>. So:</p>
<ul>
<li><code>&lt;html&gt; you &amp;amp; i &lt;/html&gt;</code> -&gt; you &amp; i</li>
</ul>
<p>but</p>
<ul>
<li><code>&lt;html&gt; you &amp; i &lt;/html&gt;</code> -&gt; you &amp; i</li>
</ul>
<p>and even</p>
<ul>
<li><code>&lt;html&gt; you &amp;zz; i &lt;/html&gt;</code> -&gt; you &amp;zz; i</li>
</ul>
<p>So my question is, <strong>do any of the xml parsers in the .net framework (or .Net, core, or standard for that matter) allow turning on this behaviour, that is, obey existing valid escape sequences, but if it isn't valid, allow it as a literal?</strong></p>
<p>Sincere thanks for any help :-)</p>
",https://stackoverflow.com/questions/67875740/parse-xml-with-ampersand-and-with-c-on-net-framework-cant-control-s,"['c#', '.net', 'xml', 'frameworks']",264,False,0,0
"Lua / FiveM, why fetching hashed objects is slow?","<p>My introduction to Lua has been through building a FiveM Role Play server using ESX v1.2. There's many inefficiencies in the code and I've isolated the majority of them which were causing &quot;server thread hitches&quot; in the server, but there's one thing I'm a little lost on.</p>
<p>There's an &quot;extended player&quot; object which holds a bunch of RP specific information aggregated from various database calls, commonly called xPlayer. Each player has a server id which is a number and there's a lua table called ESX.Players and the xPlayer is stored with a hash with <code>ESX.Players[source] = xPlayer</code></p>
<p>There's a function:</p>
<pre><code>ESX.GetPlayerFromId = function(source)
    return ESX.Players[tonumber(source)]
end
</code></pre>
<p>which wraps the fetch by hash which is where we get lots of server hitches happening. In calling code I've taken out all processing logic to leave just this function call in place and the hitches happen still and commenting it the issue goes away. The question is why given it's just pulling from a hashtable causing lag when the things in the hashtable are already instantiated tables and are NOT reaching out to touch any IO or do anything fancy in the process? It's just a stored instance.</p>
<p>The one thing that stands out to me is there are a hand full of values on the xPlayer table followed by MANY functions. Is the weight of those functions on a Lua table enough to slow down returning a reference to that? This file shows where the extended player table is created and returned <a href=""https://github.com/esx-framework/es_extended/blob/v1-final/server/classes/player.lua"" rel=""nofollow noreferrer"">https://github.com/esx-framework/es_extended/blob/v1-final/server/classes/player.lua</a></p>
<p>I am in the process of pushing all those functions onto a dedicated utility table that will exist once and each of them take an xPlayer argument to be processed by the function. There's thousands of calls throughout the 100+ FiveM resources back onto the xPlayer.() calls, so the weight of code churn and regression testing is epic therefore right now the codebase is not in a state to release to a production server to test with 40+ players hammering it yet. Can anyone confirm if I'm on the right track, is lifting away the functions of the xPlayer tables likely to give me any performance improvement when fetching by hashed key? And if so why?</p>
",https://stackoverflow.com/questions/67579606/lua-fivem-why-fetching-hashed-objects-is-slow,"['lua', 'fivem']",370,False,0,0
How to take full-page screenshots with Testcaf&#233; correctly?,"<p>We are trying to set up screenshot tests to automate UI/ layout regression testing by comparing screenshots against an expected set of screenshots. We are using testcafé for that but we are struggling when scrollbars come into play for full-page fixed width screenshots:</p>
<pre><code>const testcafe: TestController;
await testcafe
  .resizeWindow(1024, 768)
  .takeScreenshot({
    fullPage: true
  });
</code></pre>
<p>This will result in a screenshot with a width of 1003px (not 1024px!) and a height of 1546px. Nonetheless, the screenshot still contains the vertical scrollbar which is surely not out of coincidence 21px wide. It's neither full page as few pixels are also missing at the bottom of the page which most likely does actually result in the vertical scrollbar.</p>
<p>When trying to workaround the reduced width by adding additional pixels (21 to be exact), the screenshot is indeed 1024px wide and has a slightly reduced height of 1510px (as something on the page is not required to be wrapped anymore). It's still missing parts at the bottom of the screenshot and it still has a scrollbar.</p>
<pre><code>const testcafe: TestController;
await testcafe
  .resizeWindow(1024+21, 768)
  .takeScreenshot({
    fullPage: true
  });
</code></pre>
<p>Now it gets slightly more weird: The behavior just described continues up to a width of 1024+21+20 px. Screenshots have a width of (1024-21) +21+20 px, a height of 1510px and scrollbar. Starting from 1024+2*21 though the vertical scrollbar disappears, the screenshot is complete also at the bottom with 1510px as the correct height (as again something else on the page doesn't have to wrap anymore) - but unfortunately I do have a screenshot with a width of 1045px which is not of the intended width of 1024px.</p>
<p>If I specify resizeWindow with a width of 1024px I do expect a screenshot exactly of that width if it does include a scrollbar. If testcafe thinks it has to take the screenshot without the scrollbar and reduce the screenshot to a width of 1003px it's also fine with me - but here I guess it has somehow considered the scrollbar but still not actually cut it off.</p>
<p>The same mechanism for a page which content doesn't require the height of 768px, in other words doesn't have a scrollbar to begin with, the screenshot has a width of 1024px without any &quot;correction&quot;.</p>
<p>Few versions if relevant:</p>
<ul>
<li>node: v14.16.0</li>
<li>testcafe: 1.10.1</li>
<li>browser: Chrome 89.0.4389.72 running on Windows 10</li>
</ul>
<p>Do you have any further ideas?</p>
",https://stackoverflow.com/questions/66465995/how-to-take-full-page-screenshots-with-testcaf%c3%a9-correctly,"['testing', 'automation', 'automated-tests', 'e2e-testing', 'testcafe']",542,False,1,0
Spring Data JPA Additional EntityManagerFactory Optimized for Cache and Bulk Operations Only,"<p>I have a legacy Spring Data JPA application that has a large number of Entities and CrudRepositories. JPA is configured using the XML below. We have a new requirement that requires us to insert 10,000 - 50,000 entities into the database at once via a FileUpload. With the existing configuration the database CPU spikes. After enabling hibernate statistics, its was apparent that these 10,000 insert operations were generating over 200,000 DB queries due to all the validation logic required with a single insert in the <code>InvoiceService</code>.</p>
<p><strong>Original Configuration</strong></p>
<pre><code>&lt;bean id=&quot;dataSource&quot; destroy-method=&quot;close&quot; class=&quot;org.apache.commons.dbcp2.BasicDataSource&quot;&gt;
    &lt;property name=&quot;driverClassName&quot; value=&quot;${db.driver}&quot;/&gt;
    &lt;property name=&quot;url&quot; value=&quot;${db.jdbcurl}&quot;/&gt;
    &lt;property name=&quot;username&quot; value=&quot;${db.username}&quot;/&gt;
    &lt;property name=&quot;password&quot; value=&quot;${db.password}&quot;/&gt;

    &lt;property name=&quot;maxTotal&quot; value=&quot;${db.maxTotal}&quot;/&gt;
    &lt;property name=&quot;maxIdle&quot; value=&quot;${db.maxIdle}&quot;/&gt;
    &lt;property name=&quot;minIdle&quot; value=&quot;${db.minIdle}&quot;/&gt;
    &lt;property name=&quot;initialSize&quot; value=&quot;${db.initialSize}&quot;/&gt;
    &lt;property name=&quot;maxWaitMillis&quot; value=&quot;${db.maxWaitMillis}&quot;/&gt;
    &lt;property name=&quot;minEvictableIdleTimeMillis&quot; value=&quot;${db.minEvictableIdleTimeMillis}&quot;/&gt;
    &lt;property name=&quot;timeBetweenEvictionRunsMillis&quot; value=&quot;${db.timeBetweenEvictionRunsMillis}&quot;/&gt;
    &lt;property name=&quot;testOnBorrow&quot; value=&quot;${db.testOnBorrow}&quot;/&gt;
    &lt;property name=&quot;testOnReturn&quot; value=&quot;${db.testOnReturn}&quot;/&gt;
    &lt;property name=&quot;testWhileIdle&quot; value=&quot;${db.testWhileIdle}&quot;/&gt;
    &lt;property name=&quot;removeAbandonedOnBorrow&quot; value=&quot;${db.removeAbandonedOnBorrow}&quot;/&gt;
    &lt;property name=&quot;removeAbandonedOnMaintenance&quot; value=&quot;${db.removeAbandonedOnMaintenance}&quot;/&gt;
    &lt;property name=&quot;removeAbandonedTimeout&quot; value=&quot;${db.removeAbandonedTimeout}&quot;/&gt;
    &lt;property name=&quot;logAbandoned&quot; value=&quot;${db.logAbandoned}&quot;/&gt;
&lt;/bean&gt;

&lt;bean id=&quot;entityManagerFactory&quot;
    class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot; depends-on=&quot;flyway&quot;&gt;
    &lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&gt;
    &lt;property name=&quot;packagesToScan&quot; value=&quot;my.package.domain&quot; /&gt;
    &lt;property name=&quot;loadTimeWeaver&quot;&gt;
        &lt;bean class=&quot;org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver&quot; /&gt;
    &lt;/property&gt;
    &lt;property name=&quot;jpaVendorAdapter&quot;&gt;
        &lt;bean class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot; /&gt;
    &lt;/property&gt;
    &lt;property name=&quot;jpaProperties&quot;&gt;
        &lt;props&gt;
            &lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;${hibernate.hbm2ddl.auto:validate}&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.PostgreSQL9Dialect&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.show_sql&quot;&gt;${hibernate.show_sql:false}&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;
    &lt;property name=&quot;persistenceUnitName&quot; value=&quot;entityManagerFactory&quot; /&gt;
&lt;/bean&gt;

&lt;bean id=&quot;persistenceAnnotationBeanPostProcessor&quot; class=&quot;org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor&quot;&gt;
    &lt;property name=&quot;defaultPersistenceUnitName&quot; value=&quot;entityManagerFactory&quot;/&gt;
&lt;/bean&gt;

&lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.jpa.JpaTransactionManager&quot;&gt;
    &lt;property name=&quot;entityManagerFactory&quot; ref=&quot;entityManagerFactory&quot; /&gt;
&lt;/bean&gt;

&lt;tx:annotation-driven proxy-target-class=&quot;true&quot; /&gt;

&lt;bean id=&quot;persistenceExceptionTranslationPostProcessor&quot;
    class=&quot;org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor&quot; /&gt;

&lt;jpa:repositories base-package=&quot;my.package.repository&quot; entity-manager-factory-ref=&quot;entityManagerFactory&quot;/&gt;
</code></pre>
<p>The FileUploadService snippet looks like this...</p>
<pre><code>    EntityManager batchEntityManager = entityManagerFactory.createEntityManager();
    EntityTransaction transaction = batchEntityManager.getTransaction();
    transaction.begin();
    try (BufferedReader buffer = new BufferedReader(new InputStreamReader(file.getInputStream()))) {

        buffer.lines()
            .filter(StringUtils::isNotBlank)
            .forEach(csvLine -&gt; {
                invoiceService.createInvoice(csvLine);
                if (counter.incrementAndGet() % (updateFrequency.equals(0) ? 1 : updateFrequency) == 0) {
                    FileUpload fileUpload1 = fileUploadRepository.findOne(fileUpload.getId());
                    fileUpload1.setNumberOfSentRecords(sentCount.get());
                    fileUploadRepository.save(fileUpload1);
                    transaction.commit();
                    transaction.begin();
                    batchEntityManager.clear();
                }
            });
          transaction.commit();
    } catch (IOException ex) {
        systemException.incrementAndGet();
        log.error(&quot;Unexpected error while performing send task.&quot;, ex);
        transaction.rollback();
    }

    // Update FileUpload status.
    FileUpload fileUpload1 = fileUploadRepository.findOne(fileUpload.getId());
    fileUpload1.setNumberOfSentRecords(sentCount.get());
    if (systemException.get() != 0) {
        fileUpload1.setStatus(FileUploadStatus.SYSTEM_ERROR);
    } else {
        fileUpload1.setStatus(FileUploadStatus.SENT);
    }
    fileUploadRepository.save(fileUpload1);
    batchEntityManager.close();
</code></pre>
<p>Most of the DB queries were select statements that return the same results for each record being inserted. It was obvious that enabling EhCache as a Second-Level cache would have a significant performance improvement. However, this application has been running flawlessly in production for several years without ehcache enabled. I am hesitant to turn this on globally as I do not know how this will affect the large number of other repositories/queries.</p>
<p><strong>Question 1</strong></p>
<p>Is there a way to configure a &quot;alternate&quot; EntityManagerFactory that uses the second level cache for this batch process only? How can I choose to use this factory instead of the primary for this batch process only?</p>
<p>I experimented adding something like below to my spring config. I can easily inject this additional EntityManager into my class and use it. However, the existing Repositories (such as FileUploadRepository) don't seem to use it - they just return null. I am not sure if this approach is possible. The <a href=""https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/orm/jpa/JpaTransactionManager.html"" rel=""nofollow noreferrer"">documentation</a> for <code>JpaTransactionManager</code> says</p>
<blockquote>
<p>This transaction manager is appropriate for applications that use a single JPA EntityManagerFactory for transactional data access</p>
</blockquote>
<p>which is exactly what I am <em>not</em> doing. So what other options are there?</p>
<pre><code>&lt;bean id=&quot;batchEntityManagerFactory&quot;
    class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot; depends-on=&quot;flyway&quot;&gt;
    &lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&gt;
    &lt;property name=&quot;packagesToScan&quot; value=&quot;my.package.domain&quot; /&gt;
    &lt;property name=&quot;loadTimeWeaver&quot;&gt;
        &lt;bean class=&quot;org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver&quot; /&gt;
    &lt;/property&gt;
    &lt;property name=&quot;jpaVendorAdapter&quot;&gt;
        &lt;bean class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot; /&gt;
    &lt;/property&gt;
    &lt;property name=&quot;jpaProperties&quot;&gt;
        &lt;props&gt;
            &lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;${hibernate.hbm2ddl.auto:validate}&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.PostgreSQL9Dialect&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.show_sql&quot;&gt;${hibernate.show_sql:false}&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.generate_statistics&quot;&gt;${hibernate.generate_statistics:false}&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.ejb.interceptor&quot;&gt;my.package.HibernateStatistics&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.cache.use_query_cache&quot;&gt;true&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.cache.use_second_level_cache&quot;&gt;true&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.cache.region.factory_class&quot;&gt;org.hibernate.cache.ehcache.EhCacheRegionFactory&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.jdbc.batch_size&quot;&gt;100&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.order_inserts&quot;&gt;true&lt;/prop&gt;
            &lt;prop key=&quot;hibernate.order_updates&quot;&gt;true&lt;/prop&gt;
        &lt;/props&gt;
    &lt;/property&gt;
    &lt;property name=&quot;persistenceUnitName&quot; value=&quot;entityManagerFactory&quot; /&gt;
&lt;/bean&gt;
</code></pre>
<p><strong>Question 2</strong></p>
<p>Assuming there is no other option to &quot;selectively&quot; use EhCache, I tried enabling it on the primary EntityManagerFactory only. We can certainly do regression testing to make sure we don't introduce new issues. I assume this is fairly safe to do?  However, another issue came up. I am trying to commit inserts in batches as described in <a href=""https://vladmihalcea.com/the-best-way-to-do-batch-processing-with-jpa-and-hibernate/"" rel=""nofollow noreferrer"">this post</a> and shown in my code above. I am getting an RollbackException when trying to commit the batch due to <code>Connection org.postgresql.jdbc.PgConnection@1e7eb804 is closed.</code>. I presume this is due to the <code>maxWaitMillis</code> property on the dataSource.</p>
<p>I don't want to change this property for every other existing spring Service/Repository/query in the application. If I could use the &quot;custom&quot; EntityManagerFactory I could easily provide a different DataSource Bean with the properties I want. Again, is this possible?</p>
<p>Maybe I looking at this problem all wrong. Are there any other suggestions?</p>
",https://stackoverflow.com/questions/65690731/spring-data-jpa-additional-entitymanagerfactory-optimized-for-cache-and-bulk-ope,"['java', 'spring', 'hibernate', 'spring-data-jpa', 'ehcache']",126,False,0,1
